From patchwork Fri Apr 25 09:08:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 4058311 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 7BB209F319 for ; Fri, 25 Apr 2014 09:11:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC042203AB for ; Fri, 25 Apr 2014 09:11:03 +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 87B59203AA for ; Fri, 25 Apr 2014 09:11:02 +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 1Wdc7j-0000wd-90; Fri, 25 Apr 2014 09:08:47 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wdc7g-0000tO-Jc for linux-arm-kernel@lists.infradead.org; Fri, 25 Apr 2014 09:08:45 +0000 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4K00LQCXDVK020@mailout1.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 epcpsbgr1.samsung.com (EPCPMTA) with SMTP id E3.BE.18501.3062A535; Fri, 25 Apr 2014 18:08:19 +0900 (KST) X-AuditID: cbfee68d-b7f4e6d000004845-02-535a26036a04 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9F.D4.27725.3062A535; Fri, 25 Apr 2014 18:08:19 +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:19 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCH 5/5] devfreq: exynos5: Use devm_devfreq_* function using device resource management Date: Fri, 25 Apr 2014 18:08:14 +0900 Message-id: <1398416894-6782-6-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+NgFtrAIsWRmVeSWpSXmKPExsWyRsSkRJdZLSrY4PMJQ4vHaxYzWWycsZ7V Yt7Et+wW1788Z7XYPWcxi0XvgqtsFmeb3rBbrF+wkM1i0+NrrBaXd81hs/jce4TRYsb5fUwW txtXsFm8+XGWyeLxCqDek396GR0EPHbOusvusXjPSyaPO9f2sHlsXlLv0bdlFaPHmQVH2D2O 39jO5PF5k1wARxSXTUpqTmZZapG+XQJXxr1ZT5kLTolUbG7rYWpg3CHYxcjBISFgItFzvb6L kRPIFJO4cG89G4gtJLCUUeLpEXGIuInEkbf/GLsYuYDiixglji35wgThNDFJdJ1oYwepYhPQ ktj/4gZYt4iAucSupT/BbGaBy8wSj/fogtjCAqkS/759YgaxWQRUJXY8OsUIYvMKuEhsfdvN ArFNTuLDnkdgMzkFXCXaf75lhbjIRaLx8St2kMUSAl/ZJWbNfc8IMUhA4tvkQywQ38hKbDrA DDFHUu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OO+BVutAIYH0 xJLU7NTUgtQimC1MHJxSDYwHueKDq3lFp8/J8BafZlfhHH9NjentksZTCs21u/6dNZk9L6j/ 77IJybMjDiz+ZMRyX1/FLiR8htO2x1nnFxvqip+aXDRLewa//o/te7MvnbfXEvTV/+Lz+NXi vxGs+dzmTJaZP/yuv+C/+ZHn0zm30+nrhSb4x5sub3mmw2mmoR1403jugZlKLMUZiYZazEXF iQDY7C07IgMAAA== 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_020844_810318_42929362 X-CRM114-Status: GOOD ( 12.84 ) X-Spam-Score: -5.7 (-----) Cc: nm@ti.com, Manish Badarkhe , Kukjin Kim , linux-pm@vger.kernel.org, Sachin Kamat , 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, Abhilash Kesavan , 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: Sachin Kamat Cc: Bartlomiej Zolnierkiewicz Cc: Manish Badarkhe Cc: Abhilash Kesavan Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org --- drivers/devfreq/exynos/exynos5_bus.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c index ab54a69..1f622f8 100644 --- a/drivers/devfreq/exynos/exynos5_bus.c +++ b/drivers/devfreq/exynos/exynos5_bus.c @@ -165,11 +165,6 @@ static int exynos5_int_get_dev_status(struct device *dev, } static void exynos5_int_exit(struct device *dev) { - struct platform_device *pdev = container_of(dev, struct platform_device, - dev); - struct busfreq_data_int *data = platform_get_drvdata(pdev); - - devfreq_unregister_opp_notifier(dev, data->devfreq); } static struct devfreq_dev_profile exynos5_devfreq_int_profile = { @@ -343,30 +338,29 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) busfreq_mon_reset(ppmu_data); - data->devfreq = devfreq_add_device(dev, &exynos5_devfreq_int_profile, + data->devfreq = devm_devfreq_add_device(dev, &exynos5_devfreq_int_profile, "simple_ondemand", NULL); - if (IS_ERR(data->devfreq)) { err = PTR_ERR(data->devfreq); - goto err_devfreq_add; + return 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"); + return err; + } err = register_pm_notifier(&data->pm_notifier); if (err) { dev_err(dev, "Failed to setup pm notifier\n"); - goto err_devfreq_add; + return err; } /* TODO: Add a new QOS class for int/mif bus */ pm_qos_add_request(&data->int_req, PM_QOS_NETWORK_THROUGHPUT, -1); return 0; - -err_devfreq_add: - devfreq_remove_device(data->devfreq); - return err; } static int exynos5_busfreq_int_remove(struct platform_device *pdev) @@ -375,7 +369,6 @@ static int exynos5_busfreq_int_remove(struct platform_device *pdev) pm_qos_remove_request(&data->int_req); unregister_pm_notifier(&data->pm_notifier); - devfreq_remove_device(data->devfreq); return 0; }