The regulator_get() function returns a regulator when it succeeds. There's
no need to check whether the regulator is NULL later on.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
if (ret < 0)
return ret;
- if (mt9m111->regulator) {
- ret = regulator_enable(mt9m111->regulator);
- if (ret < 0)
- return ret;
- }
+ ret = regulator_enable(mt9m111->regulator);
+ if (ret < 0)
+ return ret;
ret = mt9m111_resume(mt9m111);
if (ret < 0) {
static void mt9m111_power_off(struct mt9m111 *mt9m111)
{
mt9m111_suspend(mt9m111);
- if (mt9m111->regulator)
- regulator_disable(mt9m111->regulator);
+ regulator_disable(mt9m111->regulator);
v4l2_clk_disable(mt9m111->clk);
}