Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panfrost: Add missing check for pfdev->regulator

When modifying panfrost_devfreq_target() to support a device without a
regulator defined I missed the check on the error path. Let's add it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: e21dd290881b ("drm/panfrost: Enable devfreq to work without regulator")
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190822093218.26014-1-steven.price@arm.com

authored by

Steven Price and committed by
Rob Herring
c90f3081 578d2342

+4 -2
+4 -2
drivers/gpu/drm/panfrost/panfrost_devfreq.c
··· 53 53 if (err) { 54 54 dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate, 55 55 err); 56 - regulator_set_voltage(pfdev->regulator, pfdev->devfreq.cur_volt, 57 - pfdev->devfreq.cur_volt); 56 + if (pfdev->regulator) 57 + regulator_set_voltage(pfdev->regulator, 58 + pfdev->devfreq.cur_volt, 59 + pfdev->devfreq.cur_volt); 58 60 return err; 59 61 } 60 62