Re: [PATCH v2 2/4] PM / devfreq: Add more details to the get_cur_freq() comment
From: Jie Zhan <zhanjie9@hisilicon.com>
Date: 2026-09-14 06:25:46
Also in:
linux-scsi, lkml
On 9/8/2026 3:21 AM, Bean Huo wrote:
From: Bean Huo <redacted> The comment for ->get_cur_freq() only says that the device should provide the frequency at which it is operating. It does not tell the driver author which unit to use, what the return value means, or that the frequency should be one of @freq_table. These have to be found by reading the devfreq core. Add these details to the comment. Signed-off-by: Bean Huo <redacted> Reviewed-by: Avri Altman <redacted>
Reviewed-by: Jie Zhan <zhanjie9@hisilicon.com>> ---
quoted hunk ↗ jump to hunk
include/linux/devfreq.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index dc1075dc3446..809ef29b9af5 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h@@ -90,8 +90,11 @@ struct devfreq_dev_status { * use this directly. Instead, governors are recommended * to use devfreq_update_stats() along with * devfreq.last_status. - * @get_cur_freq: The device should provide the current frequency - * at which it is operating. + * @get_cur_freq: The device should provide the frequency, in Hz, at + * which it is currently operating, and return 0, or a + * negative errno on failure. The frequency should be one + * of @freq_table, as it is used for the transition + * statistics. * @exit: An optional callback that is called when devfreq * is removing the devfreq object due to error or * from devfreq_remove_device() call. If the user