linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
       [not found] <1478596408-2958-1-git-send-email-cw00.choi@samsung.com>
@ 2016-11-08  9:13 ` Chanwoo Choi
  2016-11-09  0:17   ` Martin K. Petersen
  2016-11-08  9:16 ` Chanwoo Choi
       [not found] ` <CGME20161108091702epcas5p4779c47d7341e22697e7e49dd2f91ae0b@epcas5p4.samsung.com>
  2 siblings, 1 reply; 5+ messages in thread
From: Chanwoo Choi @ 2016-11-08  9:13 UTC (permalink / raw)
  To: myungjoo.ham, kyungmin.park
  Cc: rjw, subhashj, linux-pm, linux-kernel, Chanwoo Choi,
	Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi

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 <vinholikatti@gmail.com>
Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 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",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
       [not found] <1478596408-2958-1-git-send-email-cw00.choi@samsung.com>
  2016-11-08  9:13 ` [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Chanwoo Choi
@ 2016-11-08  9:16 ` Chanwoo Choi
  2016-11-08 20:40   ` Subhash Jadavani
       [not found] ` <CGME20161108091702epcas5p4779c47d7341e22697e7e49dd2f91ae0b@epcas5p4.samsung.com>
  2 siblings, 1 reply; 5+ messages in thread
From: Chanwoo Choi @ 2016-11-08  9:16 UTC (permalink / raw)
  To: myungjoo.ham, kyungmin.park
  Cc: rjw, subhashj, cpgs, linux-pm, linux-kernel, Chanwoo Choi,
	Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi

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 <vinholikatti@gmail.com>
Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 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",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
  2016-11-08  9:16 ` Chanwoo Choi
@ 2016-11-08 20:40   ` Subhash Jadavani
  0 siblings, 0 replies; 5+ messages in thread
From: Subhash Jadavani @ 2016-11-08 20:40 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: myungjoo.ham, kyungmin.park, rjw, cpgs, linux-pm, linux-kernel,
	Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi

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 <vinholikatti@gmail.com>
> Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Cc: linux-scsi@vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  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 <subhashj@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
  2016-11-08  9:13 ` [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Chanwoo Choi
@ 2016-11-09  0:17   ` Martin K. Petersen
  0 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2016-11-09  0:17 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: myungjoo.ham, kyungmin.park, rjw, subhashj, linux-pm,
	linux-kernel, Vinayak Holikatti, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi

>>>>> "Chanwoo" == Chanwoo Choi <cw00.choi@samsung.com> writes:

Chanwoo> This patch uses the resource-managed to add the devfreq device.
Chanwoo> This function will make it easy to handle the devfreq device.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
       [not found] ` <CGME20161108091702epcas5p4779c47d7341e22697e7e49dd2f91ae0b@epcas5p4.samsung.com>
@ 2016-11-09  1:26   ` MyungJoo Ham
  0 siblings, 0 replies; 5+ messages in thread
From: MyungJoo Ham @ 2016-11-09  1:26 UTC (permalink / raw)
  To: Chanwoo Choi, Kyungmin Park
  Cc: rjw@rjwysocki.net, subhashj@codeaurora.org, cpgs .,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

> 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 <vinholikatti@gmail.com>
> Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Cc: linux-scsi@vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>

> ---
>  drivers/scsi/ufs/ufshcd.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-09  1:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1478596408-2958-1-git-send-email-cw00.choi@samsung.com>
2016-11-08  9:13 ` [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Chanwoo Choi
2016-11-09  0:17   ` Martin K. Petersen
2016-11-08  9:16 ` Chanwoo Choi
2016-11-08 20:40   ` Subhash Jadavani
     [not found] ` <CGME20161108091702epcas5p4779c47d7341e22697e7e49dd2f91ae0b@epcas5p4.samsung.com>
2016-11-09  1:26   ` MyungJoo Ham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).