From patchwork Wed Oct 26 07:35:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9396155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C82E60234 for ; Wed, 26 Oct 2016 07:36:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 657A6298CE for ; Wed, 26 Oct 2016 07:36:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59BD0298D2; Wed, 26 Oct 2016 07:36:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A5AC298CE for ; Wed, 26 Oct 2016 07:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758312AbcJZHgc (ORCPT ); Wed, 26 Oct 2016 03:36:32 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:44578 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753674AbcJZHf7 (ORCPT ); Wed, 26 Oct 2016 03:35:59 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OFN0112193UHP10@mailout4.samsung.com>; Wed, 26 Oct 2016 16:35:54 +0900 (KST) X-AuditID: cbfee61a-f79926d000005981-f5-58105cdac9d5 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id F6.DB.22913.ADC50185; Wed, 26 Oct 2016 16:35:54 +0900 (KST) Received: from localhost.localdomain ([10.113.62.212]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OFN00FIU93T4170@mmp2.samsung.com>; Wed, 26 Oct 2016 16:35:54 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Chanwoo Choi , Vinayak Holikatti , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Date: Wed, 26 Oct 2016 16:35:50 +0900 Message-id: <1477467350-27059-3-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1477467350-27059-1-git-send-email-cw00.choi@samsung.com> References: <1477467350-27059-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPLMWRmVeSWpSXmKPExsVy+t9jQd1bMQIRBod/81tc//Kc1WLVxDyL s01v2C0u75rDZvG59wijRff1HWwWy4//Y7K43biCzeLM6UusFjsWVjlweeycdZfd48GhzSwe H5/eYvHYcrWdxaNvyypGj8+b5ALYotxsMlITU1KLFFLzkvNTMvPSbZVCQ9x0LZQU8hJzU22V InR9Q4KUFMoSc0qBPCMDNODgHOAerKRvl+CW8eLAMuaCp9wVV2/cZ29g/MbZxcjJISFgItH+ +yw7hC0mceHeerYuRi4OIYFZjBLbW+8zQjg/GCUWbdzNDFLFJqAlsf/FDTYQW0TAXGLX0p9g HcwCK5gkTvbtYAFJCAtESsyfe5a1i5GDg0VAVWLff7BeXgFXiYf9TxkhtslJfNjzCGwzp4Cb xIz/U8BmCgHVLDn7g2kCI+8CRoZVjBKpBckFxUnpuYZ5qeV6xYm5xaV56XrJ+bmbGMGB/0xq B+PBXe6HGAU4GJV4eCuO8kcIsSaWFVfmHmKU4GBWEuH9ECEQIcSbklhZlVqUH19UmpNafIjR FOiuicxSosn5wKjMK4k3NDE3MTc2sDC3tDQxUhLnbZz9LFxIID2xJDU7NbUgtQimj4mDU6qB sfKQ33Iz77f+NTs5Zth/m7LCV/58YWXQ8oqth//xWc1fUvv6bEVviTGLRFKpTNWDhd4s89+F rlrpe2b9s6DYyqcfMn6yspsttUpnnrVcScV5fwv3acnWXcsfHlEK1KpOf941c39M1jI35W1x ZTlvJjdefZb6t+Z9s5n4+skn5Q+2qB29sytwnhJLcUaioRZzUXEiAG0LRcmSAgAA X-MTR: 20000000000000000@CPGS Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch uses the resource-managed to add the devfreq device. This function will make it easy to handle the devfreq device. - struct devfreq *devm_devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile, const char *governor_name, void *data); Cc: Vinayak Holikatti Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: linux-scsi@vger.kernel.org Signed-off-by: Chanwoo Choi --- drivers/scsi/ufs/ufshcd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index f08d41a2d70b..e639071fd3a1 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6198,8 +6198,6 @@ void ufshcd_remove(struct ufs_hba *hba) scsi_host_put(hba->host); ufshcd_exit_clk_gating(hba); - if (ufshcd_is_clkscaling_enabled(hba)) - devfreq_remove_device(hba->devfreq); ufshcd_hba_exit(hba); } EXPORT_SYMBOL_GPL(ufshcd_remove); @@ -6495,7 +6493,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) } if (ufshcd_is_clkscaling_enabled(hba)) { - hba->devfreq = devfreq_add_device(dev, &ufs_devfreq_profile, + hba->devfreq = devm_devfreq_add_device(dev, &ufs_devfreq_profile, "simple_ondemand", NULL); if (IS_ERR(hba->devfreq)) { dev_err(hba->dev, "Unable to register with devfreq %ld\n",