From patchwork Fri Apr 25 09:08:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 4058321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 84FB19F319 for ; Fri, 25 Apr 2014 09:11:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B42D52039E for ; Fri, 25 Apr 2014 09:11:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD1EE2035C for ; Fri, 25 Apr 2014 09:11:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wdc7o-0000xi-EO; Fri, 25 Apr 2014 09:08:52 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wdc7e-0000tD-KF for linux-arm-kernel@lists.infradead.org; Fri, 25 Apr 2014 09:08:45 +0000 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4K005AGXDVHYD0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 25 Apr 2014 18:08:19 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 79.EE.11496.2062A535; Fri, 25 Apr 2014 18:08:19 +0900 (KST) X-AuditID: cbfee691-b7f3e6d000002ce8-bc-535a26027375 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9D.D4.27725.2062A535; Fri, 25 Apr 2014 18:08:18 +0900 (KST) Received: from chan.10.32.193.11 ([10.252.81.195]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4K007UIXDRE270@mmp1.samsung.com>; Fri, 25 Apr 2014 18:08:18 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCH 4/5] devfreq: exynos4: Use devm_devfreq_* function using device resource management Date: Fri, 25 Apr 2014 18:08:13 +0900 Message-id: <1398416894-6782-5-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1398416894-6782-1-git-send-email-cw00.choi@samsung.com> References: <1398416894-6782-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsWyRsSkRJdZLSrY4PUvZouNM9azWlz/8pzV YvecxSwWvQuuslmcbXrDbrF+wUI2i02Pr7FaXN41h83ic+8RRosZ5/cxWdxuXMFm8ebHWSaL xyveslvsXNfJ7sDnsXPWXXaPxXteMnlsXlLv0bdlFaPHmQVH2D2O39jO5LH03lFGj8+b5AI4 orhsUlJzMstSi/TtErgyzm6/zlywTqji9KzsBsZz/F2MnBwSAiYSKy42s0HYYhIX7q0Hsrk4 hASWMko0vD7NBFP0c9MrFojEIkaJb+c7GSGcJiaJeVv2sYNUsQloSex/cQNslIiAucSupT/B RjEL/GWSmDHtMViRsECqxOutr1i7GDk4WARUJVbtqAUJ8wq4SMyc/4gFYpucxIc9j8DKOQVc Jdp/vmUFsYWAahofv2IHmSkh8JJdYuOh82AJFgEBiW+TD7GAzJQQkJXYdIAZYo6kxMEVN1gm MAovYGR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BalF MFuYODilGhgPZS1kyjTZNYvv8rzKxTbFfLfzuE4tcf3bZHbfKZ5JozjZab+o1W3R3DUnK/gd ud/Yy1n1dT97M0GgzjJZcuLHZHd11lehDzf5XN/Z3yN/037SF7dbBlseZMyPPa103KNmvlkc l2/on54/H/4/mhgbMDHP9PmP/n2bT4d5M0VVTmU6ZlAac1GJpTgj0VCLuag4EQALH0h4FwMA AA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140425_020842_842948_006FF662 X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: -5.7 (-----) Cc: nm@ti.com, Kukjin Kim , Wei Yongjun , linux-pm@vger.kernel.org, jkosina@suse.cz, rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org, cw00.choi@samsung.com, labbe.montjoie@gmail.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartlomiej Zolnierkiewicz X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch uses devm_devfreq_add_device()/devm_devfreq_register_opp_notifier() to control automatically the resource of devfreq. Signed-off-by: Chanwoo Choi Cc: Kukjin Kim Cc: Bartlomiej Zolnierkiewicz Cc: Wei Yongjun Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org --- drivers/devfreq/exynos/exynos4_bus.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c index d257f1f..bebb0a4 100644 --- a/drivers/devfreq/exynos/exynos4_bus.c +++ b/drivers/devfreq/exynos/exynos4_bus.c @@ -979,7 +979,7 @@ static int exynos4_busfreq_probe(struct platform_device *pdev) platform_set_drvdata(pdev, data); - data->devfreq = devfreq_add_device(dev, &exynos4_devfreq_profile, + data->devfreq = devm_devfreq_add_device(dev, &exynos4_devfreq_profile, "simple_ondemand", NULL); if (IS_ERR(data->devfreq)) return PTR_ERR(data->devfreq); @@ -991,27 +991,20 @@ static int exynos4_busfreq_probe(struct platform_device *pdev) busfreq_mon_reset(ppmu_data); /* Register opp_notifier for Exynos4 busfreq */ - err = devfreq_register_opp_notifier(dev, data->devfreq); + err = devm_devfreq_register_opp_notifier(dev, data->devfreq); if (err < 0) { dev_err(dev, "Failed to register opp notifier\n"); - goto err_notifier_opp; + return err; } /* Register pm_notifier for Exynos4 busfreq */ err = register_pm_notifier(&data->pm_notifier); if (err) { dev_err(dev, "Failed to setup pm notifier\n"); - goto err_notifier_pm; + return err; } return 0; - -err_notifier_pm: - devfreq_unregister_opp_notifier(dev, data->devfreq); -err_notifier_opp: - devfreq_remove_device(data->devfreq); - - return err; } static int exynos4_busfreq_remove(struct platform_device *pdev) @@ -1020,10 +1013,6 @@ static int exynos4_busfreq_remove(struct platform_device *pdev) /* Unregister all of notifier chain */ unregister_pm_notifier(&data->pm_notifier); - devfreq_unregister_opp_notifier(data->dev, data->devfreq); - - /* Remove devfreq instance */ - devfreq_remove_device(data->devfreq); return 0; }