summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-03-02 12:49:54 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-03-09 08:30:46 +0100
commitc195d0aefed81af18186eaa208fd5602ab2d76ba (patch)
treec138696dc16adde9707971cae4bfa7a82db3ecde /drivers
parent09d11c546738a00754c9f1a9b726ddd14f5b5b38 (diff)
downloadbarebox-c195d0aefed81af18186eaa208fd5602ab2d76ba.tar.gz
video/ssd1307fb: drop unneeded regulator NULL checks
regulator_{enable,disable} are already no-ops when the parameter is NULL. Drop the NULL checks thusly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/ssd1307fb.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index 83a561a..cc50698 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -513,11 +513,9 @@ static int ssd1307fb_probe(struct device_d *dev)
goto reset_oled_error;
}
- if (par->vbat) {
- ret = regulator_disable(par->vbat);
- if (ret < 0)
- goto reset_oled_error;
- }
+ ret = regulator_disable(par->vbat);
+ if (ret < 0)
+ goto reset_oled_error;
i2c_set_clientdata(client, info);
@@ -525,11 +523,9 @@ static int ssd1307fb_probe(struct device_d *dev)
gpio_set_value(par->reset, 0);
udelay(4);
- if (par->vbat) {
- ret = regulator_enable(par->vbat);
- if (ret < 0)
- goto reset_oled_error;
- }
+ ret = regulator_enable(par->vbat);
+ if (ret < 0)
+ goto reset_oled_error;
mdelay(100);