Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933110AbcKHUlB (ORCPT ); Tue, 8 Nov 2016 15:41:01 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:33540 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752640AbcKHUk6 (ORCPT ); Tue, 8 Nov 2016 15:40:58 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 08 Nov 2016 12:40:57 -0800 From: Subhash Jadavani To: Chanwoo Choi Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, rjw@rjwysocki.net, cpgs@samsung.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vinayak Holikatti , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: Re: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device In-Reply-To: <1478596619-3064-1-git-send-email-cw00.choi@samsung.com> References: <1478596408-2958-1-git-send-email-cw00.choi@samsung.com> <1478596619-3064-1-git-send-email-cw00.choi@samsung.com> Message-ID: <153efd17adaed2dd87d03acbd80ad89b@codeaurora.org> User-Agent: Roundcube Webmail/1.2.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1756 Lines: 47 On 2016-11-08 01:16, Chanwoo Choi wrote: > 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", LGTM. Reviewed-by: Subhash Jadavani -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project