From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135AbcDFNuX (ORCPT ); Wed, 6 Apr 2016 09:50:23 -0400 Received: from lists.s-osg.org ([54.187.51.154]:34133 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751897AbcDFNuW (ORCPT ); Wed, 6 Apr 2016 09:50:22 -0400 From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas , Liam Girdwood , Krzysztof Kozlowski , Chanwoo Choi , Mark Brown Subject: [PATCH 2/2] regulator: max77686: Use module_platform_driver() instead subsys initcall Date: Wed, 6 Apr 2016 09:49:47 -0400 Message-Id: <1459950587-8807-2-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459950587-8807-1-git-send-email-javier@osg.samsung.com> References: <1459950587-8807-1-git-send-email-javier@osg.samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver's init and exit function don't do anything besides registering and unregistering the platform driver, so the module_platform_driver() macro could just be used instead of having separate functions. Currently the macro is not being used because the driver is initialized at subsys init call level but this isn't necessary since consumer devices are defined in the DT as dependencies so there's no need for init calls order. Signed-off-by: Javier Martinez Canillas --- This patch was tested on an Exynos5250 Snow Chromebook. drivers/regulator/max77686-regulator.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/regulator/max77686-regulator.c b/drivers/regulator/max77686-regulator.c index 17ccf365a9c0..d1ab6a4da88f 100644 --- a/drivers/regulator/max77686-regulator.c +++ b/drivers/regulator/max77686-regulator.c @@ -553,17 +553,7 @@ static struct platform_driver max77686_pmic_driver = { .id_table = max77686_pmic_id, }; -static int __init max77686_pmic_init(void) -{ - return platform_driver_register(&max77686_pmic_driver); -} -subsys_initcall(max77686_pmic_init); - -static void __exit max77686_pmic_cleanup(void) -{ - platform_driver_unregister(&max77686_pmic_driver); -} -module_exit(max77686_pmic_cleanup); +module_platform_driver(max77686_pmic_driver); MODULE_DESCRIPTION("MAXIM 77686 Regulator Driver"); MODULE_AUTHOR("Chiwoong Byun "); -- 2.5.0