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

drm/panfrost: Remove NULL checks for regulator

devm_regulator_get() is now used to populate pfdev->regulator which
ensures that this cannot be NULL (a dummy regulator will be returned if
necessary). So remove the checks in panfrost_devfreq_target().

Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/3e3a2c8a-b4fc-8af6-39e1-b26160db2c7c@arm.com

authored by

Steven Price and committed by
Rob Herring
d18a9662 edfa0750

+4 -6
+4 -6
drivers/gpu/drm/panfrost/panfrost_devfreq.c
··· 39 39 * If frequency scaling from low to high, adjust voltage first. 40 40 * If frequency scaling from high to low, adjust frequency first. 41 41 */ 42 - if (old_clk_rate < target_rate && pfdev->regulator) { 42 + if (old_clk_rate < target_rate) { 43 43 err = regulator_set_voltage(pfdev->regulator, target_volt, 44 44 target_volt); 45 45 if (err) { ··· 53 53 if (err) { 54 54 dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate, 55 55 err); 56 - if (pfdev->regulator) 57 - regulator_set_voltage(pfdev->regulator, 58 - pfdev->devfreq.cur_volt, 59 - pfdev->devfreq.cur_volt); 56 + regulator_set_voltage(pfdev->regulator, pfdev->devfreq.cur_volt, 57 + pfdev->devfreq.cur_volt); 60 58 return err; 61 59 } 62 60 63 - if (old_clk_rate > target_rate && pfdev->regulator) { 61 + if (old_clk_rate > target_rate) { 64 62 err = regulator_set_voltage(pfdev->regulator, target_volt, 65 63 target_volt); 66 64 if (err)