aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/lima/lima_devfreq.c
diff options
context:
space:
mode:
authorViresh Kumar <[email protected]>2022-07-04 10:40:39 +0000
committerViresh Kumar <[email protected]>2022-07-08 05:56:44 +0000
commit87686cc845c3be7dea777f1dbf2de0767007cda8 (patch)
treec1a21bfe9ebad676f452baf132a586041dda4273 /drivers/gpu/drm/lima/lima_devfreq.c
parentOPP: Track if clock name is configured by platform (diff)
downloadkernel-87686cc845c3be7dea777f1dbf2de0767007cda8.tar.gz
kernel-87686cc845c3be7dea777f1dbf2de0767007cda8.zip
OPP: Make dev_pm_opp_set_regulators() accept NULL terminated list
Make dev_pm_opp_set_regulators() accept a NULL terminated list of names instead of making the callers keep the two parameters in sync, which creates an opportunity for bugs to get in. Suggested-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Steven Price <[email protected]> # panfrost Reviewed-by: Chanwoo Choi <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/lima/lima_devfreq.c')
-rw-r--r--drivers/gpu/drm/lima/lima_devfreq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c
index 8989e215dfc9..dc83c5421125 100644
--- a/drivers/gpu/drm/lima/lima_devfreq.c
+++ b/drivers/gpu/drm/lima/lima_devfreq.c
@@ -111,6 +111,7 @@ int lima_devfreq_init(struct lima_device *ldev)
struct dev_pm_opp *opp;
unsigned long cur_freq;
int ret;
+ const char *regulator_names[] = { "mali", NULL };
if (!device_property_present(dev, "operating-points-v2"))
/* Optional, continue without devfreq */
@@ -122,7 +123,7 @@ int lima_devfreq_init(struct lima_device *ldev)
if (ret)
return ret;
- ret = devm_pm_opp_set_regulators(dev, (const char *[]){ "mali" }, 1);
+ ret = devm_pm_opp_set_regulators(dev, regulator_names);
if (ret) {
/* Continue if the optional regulator is missing */
if (ret != -ENODEV)