* [PATCH] media: i2c: mt9p031: Remove redundant null check before clk_disable_unprepare
@ 2020-11-04 9:29 Xu Wang
2020-11-04 23:52 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-11-04 9:29 UTC (permalink / raw)
To: laurent.pinchart, mchehab, linux-media; +Cc: linux-kernel
Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
drivers/media/i2c/mt9p031.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index dc23b9ed510a..a633b934d93e 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -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)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: i2c: mt9p031: Remove redundant null check before clk_disable_unprepare
2020-11-04 9:29 [PATCH] media: i2c: mt9p031: Remove redundant null check before clk_disable_unprepare Xu Wang
@ 2020-11-04 23:52 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2020-11-04 23:52 UTC (permalink / raw)
To: Xu Wang; +Cc: mchehab, linux-media, linux-kernel, Sakari Ailus
Hi Xu Wang,
Thank you for the patch.
On Wed, Nov 04, 2020 at 09:29:48AM +0000, Xu Wang wrote:
> Because clk_disable_unprepare() already checked NULL clock parameter,
> so the additional check is unnecessary, just remove it.
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I expect Sakari will pick this patch.
> ---
> drivers/media/i2c/mt9p031.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index dc23b9ed510a..a633b934d93e 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -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)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-04 23:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 9:29 [PATCH] media: i2c: mt9p031: Remove redundant null check before clk_disable_unprepare Xu Wang
2020-11-04 23:52 ` Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).