From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933068AbbIYTKy (ORCPT ); Fri, 25 Sep 2015 15:10:54 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35269 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932924AbbIYTKx (ORCPT ); Fri, 25 Sep 2015 15:10:53 -0400 From: Shraddha Barke To: Peter De Schrijver , Prashant Gaikwad , Michael Turquette Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Shraddha Barke Subject: [PATCH] Clk: tegra: Use module_platform_driver Date: Sat, 26 Sep 2015 00:40:14 +0530 Message-Id: <1443208214-8810-1-git-send-email-shraddha.6596@gmail.com> X-Mailer: git-send-email 2.1.4 X-Cyberoam-smtpxy-version: 1.0.6.3 X-Cyberoam-AV-Policy: default X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A150206.56059C3B.0076,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use module_platform_driver for drivers whose init and exit functions only register and unregister, respectively. Coccinelle patch used- @a@ identifier f, x; @@ -static f(...) { return platform_driver_register(&x); } @b depends on a@ identifier e, a.x; @@ -static e(...) { platform_driver_unregister(&x); } @c depends on a && b@ identifier a.f; declarer name module_init; @@ -module_init(f); @d depends on a && b && c@ identifier b.e, a.x; declarer name module_exit; declarer name module_platform_driver; @@ -module_exit(e); +module_platform_driver(x); Signed-off-by: Shraddha Barke --- drivers/clk/tegra/clk-tegra124-dfll-fcpu.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c index 6125333..88b4ef4 100644 --- a/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c +++ b/drivers/clk/tegra/clk-tegra124-dfll-fcpu.c @@ -147,18 +147,7 @@ static struct platform_driver tegra124_dfll_fcpu_driver = { .pm = &tegra124_dfll_pm_ops, }, }; - -static int __init tegra124_dfll_fcpu_init(void) -{ - return platform_driver_register(&tegra124_dfll_fcpu_driver); -} -module_init(tegra124_dfll_fcpu_init); - -static void __exit tegra124_dfll_fcpu_exit(void) -{ - platform_driver_unregister(&tegra124_dfll_fcpu_driver); -} -module_exit(tegra124_dfll_fcpu_exit); +module_platform_driver(tegra124_dfll_fcpu_driver); MODULE_DESCRIPTION("Tegra124 DFLL clock source driver"); MODULE_LICENSE("GPL v2"); -- 2.1.4