summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorSakari Ailus2019-05-31 22:11:35 +0200
committerMauro Carvalho Chehab2019-06-24 17:11:43 +0200
commit9a57d72b94869ceb29f932e95cb39f0cc156ea1f (patch)
tree9860e0aec052fd6e3c5d4417bdd42385e689001f /drivers/media/i2c
parentmedia: mt9m111: add regulator support (diff)
downloadkernel-qcow2-linux-9a57d72b94869ceb29f932e95cb39f0cc156ea1f.tar.gz
kernel-qcow2-linux-9a57d72b94869ceb29f932e95cb39f0cc156ea1f.tar.xz
kernel-qcow2-linux-9a57d72b94869ceb29f932e95cb39f0cc156ea1f.zip
media: mt9m111: No need to check for the regulator
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>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/mt9m111.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index 746d1345b505..bb19f8c346cb 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -984,11 +984,9 @@ static int mt9m111_power_on(struct mt9m111 *mt9m111)
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) {
@@ -1002,8 +1000,7 @@ static int mt9m111_power_on(struct mt9m111 *mt9m111)
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);
}