summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/lima
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2022-07-04 13:40:39 +0300
committerViresh Kumar <viresh.kumar@linaro.org>2022-07-08 08:56:44 +0300
commit87686cc845c3be7dea777f1dbf2de0767007cda8 (patch)
treec1a21bfe9ebad676f452baf132a586041dda4273 /drivers/gpu/drm/lima
parent0a43452bb6b1f499b695b123e9fedf4b1a9bbf64 (diff)
downloadlinux-87686cc845c3be7dea777f1dbf2de0767007cda8.tar.xz
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 <gregkh@linuxfoundation.org> Reviewed-by: Steven Price <steven.price@arm.com> # panfrost Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/lima')
-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)