regulator_{enable,disable} are already no-ops when the parameter is NULL. Drop the NULL checks thusly. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- drivers/video/ssd1307fb.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c index 83a561a3e1fc..cc50698670e0 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); -- 2.25.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox