All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: au1100fb: Check before some function not needed
@ 2022-06-08 11:43 Yihao Han
  2022-06-20 18:18 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Yihao Han @ 2022-06-08 11:43 UTC (permalink / raw)
  To: Helge Deller, Yihao Han, Geert Uytterhoeven, linux-fbdev,
	dri-devel, linux-kernel

clk_disable() already checks the clk ptr using IS_ERR_OR_NULL(clk)
and clk_enable() checks the clk ptr using !clk, so there is no
need to check clk ptr again before calling them.

Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
 drivers/video/fbdev/au1100fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 52f731a61482..519313b8bb00 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -560,8 +560,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
 	/* Blank the LCD */
 	au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);
 
-	if (fbdev->lcdclk)
-		clk_disable(fbdev->lcdclk);
+	clk_disable(fbdev->lcdclk);
 
 	memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
 
@@ -577,8 +576,7 @@ int au1100fb_drv_resume(struct platform_device *dev)
 
 	memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
 
-	if (fbdev->lcdclk)
-		clk_enable(fbdev->lcdclk);
+	clk_enable(fbdev->lcdclk);
 
 	/* Unblank the LCD */
 	au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] video: fbdev: au1100fb: Check before some function not needed
  2022-06-08 11:43 [PATCH] video: fbdev: au1100fb: Check before some function not needed Yihao Han
@ 2022-06-20 18:18 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2022-06-20 18:18 UTC (permalink / raw)
  To: Yihao Han, Geert Uytterhoeven, linux-fbdev, dri-devel, linux-kernel

On 6/8/22 13:43, Yihao Han wrote:
> clk_disable() already checks the clk ptr using IS_ERR_OR_NULL(clk)
> and clk_enable() checks the clk ptr using !clk, so there is no
> need to check clk ptr again before calling them.
>
> Signed-off-by: Yihao Han <hanyihao@vivo.com>

applied to fbdev tree.

Thanks!
Helge

> ---
>  drivers/video/fbdev/au1100fb.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
> index 52f731a61482..519313b8bb00 100644
> --- a/drivers/video/fbdev/au1100fb.c
> +++ b/drivers/video/fbdev/au1100fb.c
> @@ -560,8 +560,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
>  	/* Blank the LCD */
>  	au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);
>
> -	if (fbdev->lcdclk)
> -		clk_disable(fbdev->lcdclk);
> +	clk_disable(fbdev->lcdclk);
>
>  	memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
>
> @@ -577,8 +576,7 @@ int au1100fb_drv_resume(struct platform_device *dev)
>
>  	memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
>
> -	if (fbdev->lcdclk)
> -		clk_enable(fbdev->lcdclk);
> +	clk_enable(fbdev->lcdclk);
>
>  	/* Unblank the LCD */
>  	au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-20 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:43 [PATCH] video: fbdev: au1100fb: Check before some function not needed Yihao Han
2022-06-20 18:18 ` Helge Deller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.