linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: aspeed: Remove redundant null check before clk_disable_unprepare
@ 2020-12-04  8:51 Xu Wang
  2020-12-07  0:12 ` Andrew Jeffery
  0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-12-04  8:51 UTC (permalink / raw)
  To: balbi, gregkh, joel, andrew, rentao.bupt, benh, linux-arm-kernel,
	linux-aspeed
  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/usb/gadget/udc/aspeed-vhub/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c b/drivers/usb/gadget/udc/aspeed-vhub/core.c
index be7bb64e3594..ea47f4b98de9 100644
--- a/drivers/usb/gadget/udc/aspeed-vhub/core.c
+++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c
@@ -282,8 +282,7 @@ static int ast_vhub_remove(struct platform_device *pdev)
 	       VHUB_CTRL_PHY_RESET_DIS,
 	       vhub->regs + AST_VHUB_CTRL);
 
-	if (vhub->clk)
-		clk_disable_unprepare(vhub->clk);
+	clk_disable_unprepare(vhub->clk);
 
 	spin_unlock_irqrestore(&vhub->lock, flags);
 
-- 
2.17.1


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

* Re: [PATCH] usb: gadget: aspeed: Remove redundant null check before clk_disable_unprepare
  2020-12-04  8:51 [PATCH] usb: gadget: aspeed: Remove redundant null check before clk_disable_unprepare Xu Wang
@ 2020-12-07  0:12 ` Andrew Jeffery
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Jeffery @ 2020-12-07  0:12 UTC (permalink / raw)
  To: Xu Wang, Felipe Balbi, Greg Kroah-Hartman, Joel Stanley, Tao Ren,
	Benjamin Herrenschmidt, linux-arm-kernel, linux-aspeed
  Cc: linux-kernel



On Fri, 4 Dec 2020, at 19:21, 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>

Pity we have to dig through the implementation of clk_disable_unprepare() to 
figure this out, but oh well.

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

> ---
>  drivers/usb/gadget/udc/aspeed-vhub/core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c 
> b/drivers/usb/gadget/udc/aspeed-vhub/core.c
> index be7bb64e3594..ea47f4b98de9 100644
> --- a/drivers/usb/gadget/udc/aspeed-vhub/core.c
> +++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c
> @@ -282,8 +282,7 @@ static int ast_vhub_remove(struct platform_device 
> *pdev)
>  	       VHUB_CTRL_PHY_RESET_DIS,
>  	       vhub->regs + AST_VHUB_CTRL);
>  
> -	if (vhub->clk)
> -		clk_disable_unprepare(vhub->clk);
> +	clk_disable_unprepare(vhub->clk);
>  
>  	spin_unlock_irqrestore(&vhub->lock, flags);
>  
> -- 
> 2.17.1
> 
>

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

end of thread, other threads:[~2020-12-07  0:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  8:51 [PATCH] usb: gadget: aspeed: Remove redundant null check before clk_disable_unprepare Xu Wang
2020-12-07  0:12 ` Andrew Jeffery

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).