Re: [PATCH v2] devfreq: governor: Add a private governor_data for governors in devfreq

From: Kant Fan
Date: Fri Oct 14 2022 - 05:47:04 EST


On 10/13/2022 3:19 AM, Chanwoo Choi wrote:

In addition, the devfreq driver pass the 'data' from devfreq driver
to governor by using devfreq_add_device. I think that 'devfreq driver'
is more proper

* @data: devfreq driver pass to governors, governor should not change it.

And then, there are extra changes required.

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 63347a5ae599..0c59b7978391 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -776,8 +776,7 @@ static void remove_sysfs_files(struct devfreq *devfreq,
* @dev: the device to add devfreq feature.
* @profile: device-specific profile to run devfreq.
* @governor_name: name of the policy to choose frequency.
- * @data: private data for the governor. The devfreq framework does not
- * touch this value.
+ * @data: devfreq driver pass to governors, governor should not change it.
*/
struct devfreq *devfreq_add_device(struct device *dev,
struct devfreq_dev_profile *profile,
@@ -1011,8 +1010,7 @@ static void devm_devfreq_dev_release(struct device *dev, void *res)
* @dev: the device to add devfreq feature.
* @profile: device-specific profile to run devfreq.
* @governor_name: name of the policy to choose frequency.
- * @data: private data for the governor. The devfreq framework does not
- * touch this value.
+ * @data: devfreq driver pass to governors, governor should not change it.
*
* This function manages automatically the memory of devfreq device using device
* resource management and simplify the free operation for memory of devfreq


Dear Chanwoo,
Thanks for your kindly advice. I've modified it as patch-v3 [1]. Please have a look.

[1] https://lore.kernel.org/all/20221014094359.100995-1-kant@xxxxxxxxxxxxxxxxx/

--
Best Regards,
Kant Fan