From patchwork Tue Nov 8 09:13:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9416957 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 9B59160459 for ; Tue, 8 Nov 2016 09:14:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CC692875E for ; Tue, 8 Nov 2016 09:14:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8170028829; Tue, 8 Nov 2016 09:14:00 +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 1979D287BA for ; Tue, 8 Nov 2016 09:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932726AbcKHJNo (ORCPT ); Tue, 8 Nov 2016 04:13:44 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:43745 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932624AbcKHJNi (ORCPT ); Tue, 8 Nov 2016 04:13:38 -0500 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGB002ZCGAJSLC0@mailout2.samsung.com>; Tue, 08 Nov 2016 18:13:31 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-88-5821973b53a9 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 91.6B.25310.B3791285; Tue, 8 Nov 2016 18:13:31 +0900 (KST) Received: from localhost.localdomain ([10.113.62.212]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGB00H01GAI9M00@mmp1.samsung.com>; Tue, 08 Nov 2016 18:13:31 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Cc: rjw@rjwysocki.net, subhashj@codeaurora.org, 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 v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Date: Tue, 08 Nov 2016 18:13:28 +0900 Message-id: <1478596408-2958-3-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1478596408-2958-1-git-send-email-cw00.choi@samsung.com> References: <1478596408-2958-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xgK71dMUIgw/tohbXvzxntVg1Mc/i bNMbdovLu+awWXzuPcJo0X19B5vF8uP/mCxuN65gszhz+hKrxY3FO9ksdiyscuD2uNzXy+Sx c9Zddo8HhzazeHx8eovFY8vVdhaPvi2rGD0+b5ILYI9ys8lITUxJLVJIzUvOT8nMS7dVCg1x 07VQUshLzE21VYrQ9Q0JUlIoS8wpBfKMDNCAg3OAe7CSvl2CW8aMU29YC55zV+yb/YW1gfE7 ZxcjJ4eEgInEvfnX2CFsMYkL99azdTFycQgJLGWUOLJzAyuE84NR4uLOHkaQKjYBLYn9L26w gdgiAuYSu5b+BOtgFjjIJDG1YQUTSEJYIEbi0KZesLEsAqoSlzf9AmvmFXCROHMewpYQkJP4 sOcRWA2ngKvEyy/bwXqFgGp69vxmn8DIu4CRYRWjRGpBckFxUnquYV5quV5xYm5xaV66XnJ+ 7iZGcDw8k9rBeHCX+yFGAQ5GJR7eDhnFCCHWxLLiytxDjBIczEoivDenAoV4UxIrq1KL8uOL SnNSiw8xmgIdNpFZSjQ5HxireSXxhibmJubGBhbmlpYmRkrivI2zn4ULCaQnlqRmp6YWpBbB 9DFxcEo1MFb6qv2O2txi9XWqjAZnFC/rta1JmvsbcqZd2rj3r9jz+BXiAn/473IdfrDrd86z whKJoODiuFMrlXq3eJu1WhUtUHn+bbGw+pnX/E8i67rlJAu0o786cBd3KUltkj1948ehn7v3 i05rqflV/MT68RebqO8353UsuHfu2XIOv6WCzKzn5FNvMSqxFGckGmoxFxUnAgA0bmD4nQIA AA== 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 e491c4bda32f..e8c5ba274830 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6250,8 +6250,6 @@ void ufshcd_remove(struct ufs_hba *hba) ufshcd_hba_stop(hba, true); 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); @@ -6579,7 +6577,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",