Skip to contentSkip to conversation

media: i2c: mt9p031: Remove redundant null check before clk_disable_unprepare

PATCH In review Xu Wang 2 participants 2 messages Nov 4, 2020

Subsystems (3)
lore
Share & tools
lore

Xu Wang

author
#0 lore raw

PATCH 1/1 media: i2c: mt9p031: Remove redundant null check before clk_disable_unprepare

Because clk_disable_unprepare() already checked NULL clock parameter, so the additional check is unnecessary, just remove it.

---
 drivers/media/i2c/mt9p031.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/i2c/mt9p031.c +1 -2
index dc23b9ed510a..a633b934d93e 100644
@@ -346,8 +346,7 @@ static void mt9p031_power_off(struct mt9p031 *mt9p031)
 	regulator_bulk_disable(ARRAY_SIZE(mt9p031->regulators),
 			       mt9p031->regulators);
 
-	if (mt9p031->clk)
-		clk_disable_unprepare(mt9p031->clk);
+	clk_disable_unprepare(mt9p031->clk);
 }
 
 static int __mt9p031_set_power(struct mt9p031 *mt9p031, bool on)
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Xu Wang,

Thank you for the patch.

Quoted 4 lines · Xu Wang

Because clk_disable_unprepare() already checked NULL clock parameter, so the additional check is unnecessary, just remove it.

I expect Sakari will pick this patch.

Quoted 18 lines
---
 drivers/media/i2c/mt9p031.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/i2c/mt9p031.c +1 -2
index dc23b9ed510a..a633b934d93e 100644
@@ -346,8 +346,7 @@ static void mt9p031_power_off(struct mt9p031 *mt9p031)
 	regulator_bulk_disable(ARRAY_SIZE(mt9p031->regulators),
 			       mt9p031->regulators);
 
-	if (mt9p031->clk)
-		clk_disable_unprepare(mt9p031->clk);
+	clk_disable_unprepare(mt9p031->clk);
 }
 
 static int __mt9p031_set_power(struct mt9p031 *mt9p031, bool on)
Signature · 3 lines
Regards,

Laurent Pinchart