From patchwork Tue Nov 8 09:16:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 9416967 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 05F4D60459 for ; Tue, 8 Nov 2016 09:17:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EACC628A02 for ; Tue, 8 Nov 2016 09:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCEE728A33; Tue, 8 Nov 2016 09:17:08 +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 EAC2628A02 for ; Tue, 8 Nov 2016 09:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932489AbcKHJRF (ORCPT ); Tue, 8 Nov 2016 04:17:05 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:47274 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932751AbcKHJRE (ORCPT ); Tue, 8 Nov 2016 04:17:04 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGB028M0GGEHWB0@mailout4.samsung.com>; Tue, 08 Nov 2016 18:17:02 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-01-5821980ec866 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 98.2C.16530.E0891285; Tue, 8 Nov 2016 18:17:02 +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 <0OGB00K7PGGEMRB0@mmp2.samsung.com>; Tue, 08 Nov 2016 18:17:02 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Cc: rjw@rjwysocki.net, subhashj@codeaurora.org, cpgs@samsung.com, 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:16:59 +0900 Message-id: <1478596619-3064-1-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+NgFupjkeLIzCtJLcpLzFFi42I5/e+xoC7fDMUIg193JS1eHtK0uP7lOavF qol5Fmeb3rBbXN41h83ic+8RRovu6zvYLJYf/8dkcbtxBZvFmdOXWC1uLN7JZrFjYZUDj8fl vl4mj52z7rJ7PDi0mcXj49NbLB5brrazePRtWcXo8XmTXAB7lJtNRmpiSmqRQmpecn5KZl66 rVJoiJuuhZJCXmJuqq1ShK5vSJCSQlliTimQZ2SABhycA9yDlfTtEtwyZpx6w1rwnLti3+wv rA2M3zm7GDk5JARMJKavm8UIYYtJXLi3nq2LkYtDSGAWo8SJD58ZIZwfjBJvJ89gBqliE9CS 2P/iBhuILSJgLrFr6U+wDmaBq0wS/b9XgRUJC8RIHNrUyw5iswioSmw9M5cJxOYVcJFYMXc/ 1Do5iQ97HoHVcAq4Srz8sh2sRgiopmfPb/YJjLwLGBlWMUqkFiQXFCel5xrlpZbrFSfmFpfm pesl5+duYgTHxTPpHYyHd7kfYhTgYFTi4XW4qxAhxJpYVlyZe4hRgoNZSYTXf5pihBBvSmJl VWpRfnxRaU5q8SFGU6DDJjJLiSbnA2M2ryTe0MTcxNzYwMLc0tLESEmct3H2s3AhgfTEktTs 1NSC1CKYPiYOTqkGxinHCg4d6l7BaC9X8S+Ty8kmtfrUU2Y2w+z6iRpTg7PWLInbpH0l/bTQ 1W7xgNtVfIziG+7aZN30ub5bpbhlOktPStXLevcow7vB7hMZFl6boD3rXc+U+aLrzpUfz0zO 6/czLnNbGbG69xqD1rvMyvUxtQeCTTTdPq0tElO5Noez81Fx+TNDJZbijERDLeai4kQABB1v nqECAAA= X-MTR: 20000000000000000@CPGS Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Reviewed-by: Subhash Jadavani --- 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",