* [PATCH 0/2] PM / devfreq: Use the resource-managed function for devfreq device
@ 2016-10-26 7:35 Chanwoo Choi
2016-10-26 7:35 ` [PATCH 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev Chanwoo Choi
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Chanwoo Choi @ 2016-10-26 7:35 UTC (permalink / raw)
To: myungjoo.ham, kyungmin.park; +Cc: rjw, linux-pm, linux-kernel, Chanwoo Choi
This patch just uses the resource-managed function when adding the new devfreq
deivce. This function handles the memory and delete of devfreq instance
automatically.
Chanwoo Choi (2):
PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev
scsi: ufs: Use the resource-managed function to add devfreq device
drivers/devfreq/rk3399_dmc.c | 2 +-
drivers/scsi/ufs/ufshcd.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev
2016-10-26 7:35 [PATCH 0/2] PM / devfreq: Use the resource-managed function for devfreq device Chanwoo Choi
@ 2016-10-26 7:35 ` Chanwoo Choi
2016-10-26 7:35 ` [PATCH 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Chanwoo Choi
2016-10-26 7:38 ` Chanwoo Choi
2 siblings, 0 replies; 5+ messages in thread
From: Chanwoo Choi @ 2016-10-26 7:35 UTC (permalink / raw)
To: myungjoo.ham, kyungmin.park; +Cc: rjw, linux-pm, linux-kernel, Chanwoo Choi
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);
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/devfreq/rk3399_dmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
index e24b73d66659..3f8f4381cd4a 100644
--- a/drivers/devfreq/rk3399_dmc.c
+++ b/drivers/devfreq/rk3399_dmc.c
@@ -436,7 +436,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
rk3399_devfreq_dmc_profile.initial_freq = data->rate;
- data->devfreq = devfreq_add_device(dev,
+ data->devfreq = devm_devfreq_add_device(dev,
&rk3399_devfreq_dmc_profile,
"simple_ondemand",
&data->ondemand_data);
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
2016-10-26 7:35 [PATCH 0/2] PM / devfreq: Use the resource-managed function for devfreq device Chanwoo Choi
2016-10-26 7:35 ` [PATCH 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev Chanwoo Choi
@ 2016-10-26 7:35 ` Chanwoo Choi
2016-10-26 7:38 ` Chanwoo Choi
2 siblings, 0 replies; 5+ messages in thread
From: Chanwoo Choi @ 2016-10-26 7:35 UTC (permalink / raw)
To: myungjoo.ham, kyungmin.park
Cc: rjw, 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 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
2016-10-26 7:35 [PATCH 0/2] PM / devfreq: Use the resource-managed function for devfreq device Chanwoo Choi
2016-10-26 7:35 ` [PATCH 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev Chanwoo Choi
2016-10-26 7:35 ` [PATCH 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Chanwoo Choi
@ 2016-10-26 7:38 ` Chanwoo Choi
2016-10-26 17:23 ` Subhash Jadavani
2 siblings, 1 reply; 5+ messages in thread
From: Chanwoo Choi @ 2016-10-26 7:38 UTC (permalink / raw)
To: myungjoo.ham, kyungmin.park
Cc: rjw, linux-pm, linux-kernel, cpgs, 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 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
2016-10-26 7:38 ` Chanwoo Choi
@ 2016-10-26 17:23 ` Subhash Jadavani
0 siblings, 0 replies; 5+ messages in thread
From: Subhash Jadavani @ 2016-10-26 17:23 UTC (permalink / raw)
To: Chanwoo Choi
Cc: myungjoo.ham, kyungmin.park, rjw, linux-pm, linux-kernel, cpgs,
Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-scsi-owner
On 2016-10-26 00:38, 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 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",
This change looks good to me but this will have merge conflicts if this
gets in after my patch series " [PATCH v1 00/11] scsi: ufs: bug fixes
patch series #1" (due to "[PATCH v1 06/11] scsi: ufs: suspend clock
scaling for failed runtime_resume"). so if you can, please pull in my
patch series and rebase your change on top of it and send it out again.
Thanks,
Subhash
--
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
end of thread, other threads:[~2016-10-26 17:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-26 7:35 [PATCH 0/2] PM / devfreq: Use the resource-managed function for devfreq device Chanwoo Choi
2016-10-26 7:35 ` [PATCH 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev Chanwoo Choi
2016-10-26 7:35 ` [PATCH 2/2] scsi: ufs: Use the resource-managed function to add devfreq device Chanwoo Choi
2016-10-26 7:38 ` Chanwoo Choi
2016-10-26 17:23 ` Subhash Jadavani
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).