From patchwork Fri May 9 07:43:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 4140601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1636DBFF02 for ; Fri, 9 May 2014 07:46:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 449F6201FA for ; Fri, 9 May 2014 07:46:19 +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 72502201F7 for ; Fri, 9 May 2014 07:46:18 +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 1WifTD-0007aa-1S; Fri, 09 May 2014 07:43:51 +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 1WifT1-0007ND-Jp for linux-arm-kernel@lists.infradead.org; Fri, 09 May 2014 07:43:42 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5A00JJQQS47K80@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 09 May 2014 16:43:16 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.112]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 0E.C4.11120.4178C635; Fri, 09 May 2014 16:43:16 +0900 (KST) X-AuditID: cbfee68f-b7eff6d000002b70-4f-536c8714819f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 8F.DE.25708.4178C635; Fri, 09 May 2014 16:43:16 +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 <0N5A00E1UQS10880@mmp1.samsung.com>; Fri, 09 May 2014 16:43:16 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [PATCHv2 4/5] devfreq: exynos4: Use devm_devfreq_* function using device resource management Date: Fri, 09 May 2014 16:43:10 +0900 Message-id: <1399621391-27228-5-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1399621391-27228-1-git-send-email-cw00.choi@samsung.com> References: <1399621391-27228-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsWyRsSkQFekPSfYYPskfYvHaxYzWWycsZ7V 4vqX56wWu+csZrHoXXCVzeJs0xt2i/ULFrJZbHp8jdXi8q45bBafe48wWsw4v4/J4nbjCjaL Nz/OMlk8XvGW3eLgwwXMFjvXdbI7CHjsnHWX3WPxnpdMHpuX1Hv0bVnF6HFmwRF2j+M3tjN5 LL13lNHj8ya5AI4oLpuU1JzMstQifbsEroyz268zF6wTqjg9K7uB8Rx/FyMnh4SAicS79VeZ IWwxiQv31rN1MXJxCAksZZT4tnwNG0zR6Xs3WSESixgldv5bzQjhNDFJHLj8nBGkik1AS2L/ ixtgHSIC5hK7lv4EG8UssI9Z4tv1q6wgCWGBdIlnh76wg9gsAqoS85d+ZAKxeQVcJSavuAF1 h5zEhz2PwGo4Bdwk1rdNAIsLgdQs64I66Su7xO6GJIg5AhLfJh9i6WLkAIrLSmw6ADVGUuLg ihssExiFFzAyrGIUTS1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w1TpQSCA9 sSQ1OzW1ILUIZgsTB6dUA6PalJJbaZK+8ktfHu7h3e76vdM60vjgJ4PspV27bb/GGHE+kt7s /XZ1ZCWrSa5V2u151XcfSXySmxl2tI597YW3js2TlnFULjyZsmOfjeRmlRNyzYmXrHOv6Sfk 35cpzVhzzvnQSj4GtxMy1ySTdv2J3/Xi493vvHXV67pELtg6mfvKlm6M/aLEUpyRaKjFXFSc CAC1boVKIgMAAA== 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-20140509_004339_854487_248A23D6 X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -5.7 (-----) Cc: nm@ti.com, sreekumar.c@samsung.com, Kukjin Kim , Wei Yongjun , linux-pm@vger.kernel.org, jkosina@suse.cz, rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org, Chanwoo Choi , labbe.montjoie@gmail.com, linux-samsung-soc@vger.kernel.org, a.kesavan@samsung.com, 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; }