Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756380AbcJZHi2 (ORCPT ); Wed, 26 Oct 2016 03:38:28 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:36348 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754658AbcJZHi0 (ORCPT ); Wed, 26 Oct 2016 03:38:26 -0400 X-AuditID: cbfee61a-f79926d000005981-03-58105d70c248 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, cpgs@samsung.com, 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:38:18 +0900 Message-id: <1477467498-27145-1-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+NgFmphkeLIzCtJLcpLzFFi42I5/e+xgG5BrECEwYOzahYvD2laXP/ynNVi 1cQ8i7NNb9gtLu+aw2bxufcIo0X39R1sFsuP/2OyuN24gs3izOlLrBY7FlY5cHvsnHWX3ePB oc0sHh+f3mLx2HK1ncWjb8sqRo/Pm+QC2KLcbDJSE1NSixRS85LzUzLz0m2VQkPcdC2UFPIS c1NtlSJ0fUOClBTKEnNKgTwjAzTg4BzgHqykb5fglvHiwDLmgqfcFVdv3GdvYPzG2cXIySEh YCIx8ecTdghbTOLCvfVsXYxcHEICSxklvt18xwjh/GCU+DXrGStIFZuAlsT+FzfYQGwRAXOJ XUt/gnUwC+xiknh0sZkFJCEsECkxf+5ZsAYWAVWJp7enMoLYvAKuEi/6NjNCrJOT+LDnEdhq TgE3iRn/p4ANFQKqWXL2B9MERt4FjAyrGCVSC5ILipPScw3zUsv1ihNzi0vz0vWS83M3MYJj 4JnUDsaDu9wPMQpwMCrx8FYc5Y8QYk0sK67MPcQowcGsJML7IUIgQog3JbGyKrUoP76oNCe1 +BCjKdBhE5mlRJPzgfGZVxJvaGJuYm5sYGFuaWlipCTO2zj7WbiQQHpiSWp2ampBahFMHxMH p1QDo2j4n2IbOTFptUevdRacmp7ka/TdWVpxzYS/ElfU9NTvVF3Mreyam9nvK1BVUXpXi9X2 ofBh1qc1dn7hVQfZMs63/bW8NZnnjyDXacH5c6b2K4Y8Ml/IKbiebatR3HNJK463UvYmm6fL s5z2WPAkTOFw5zm/Bau/1s1s9F/yj3PJ9H5thfV7lFiKMxINtZiLihMBGDnYTJcCAAA= X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1467 Lines: 40 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", -- 1.9.1