linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: uniphier: Fix some error handling in uniphier_pcie_ep_probe()
@ 2020-06-03 17:52 Dan Carpenter
  2020-06-04  0:39 ` Kunihiko Hayashi
  2020-06-04  9:07 ` Lorenzo Pieralisi
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-06-03 17:52 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Masahiro Yamada,
	linux-pci, kernel-janitors

This code is checking the wrong variable.  It should be checking
"clk_gio" instead of "clk".  The "priv->clk" pointer is NULL at this
point so the condition is false.

Fixes: 006564dee8253 ("PCI: uniphier: Add Socionext UniPhier Pro5 PCIe endpoint controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/pci/controller/dwc/pcie-uniphier-ep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-uniphier-ep.c b/drivers/pci/controller/dwc/pcie-uniphier-ep.c
index 0f36aa33d2e50..1483559600610 100644
--- a/drivers/pci/controller/dwc/pcie-uniphier-ep.c
+++ b/drivers/pci/controller/dwc/pcie-uniphier-ep.c
@@ -324,8 +324,8 @@ static int uniphier_pcie_ep_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 
 	priv->clk_gio = devm_clk_get(dev, "gio");
-	if (IS_ERR(priv->clk))
-		return PTR_ERR(priv->clk);
+	if (IS_ERR(priv->clk_gio))
+		return PTR_ERR(priv->clk_gio);
 
 	priv->rst_gio = devm_reset_control_get_shared(dev, "gio");
 	if (IS_ERR(priv->rst_gio))
-- 
2.26.2


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

* Re: [PATCH] PCI: uniphier: Fix some error handling in uniphier_pcie_ep_probe()
  2020-06-03 17:52 [PATCH] PCI: uniphier: Fix some error handling in uniphier_pcie_ep_probe() Dan Carpenter
@ 2020-06-04  0:39 ` Kunihiko Hayashi
  2020-06-04  9:07 ` Lorenzo Pieralisi
  1 sibling, 0 replies; 3+ messages in thread
From: Kunihiko Hayashi @ 2020-06-04  0:39 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas, Masahiro Yamada,
	linux-pci, kernel-janitors

Hi Dan,

On 2020/06/04 2:52, Dan Carpenter wrote:
> This code is checking the wrong variable.  It should be checking
> "clk_gio" instead of "clk".  The "priv->clk" pointer is NULL at this
> point so the condition is false.
> 
> Fixes: 006564dee8253 ("PCI: uniphier: Add Socionext UniPhier Pro5 PCIe endpoint controller driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/pci/controller/dwc/pcie-uniphier-ep.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-uniphier-ep.c b/drivers/pci/controller/dwc/pcie-uniphier-ep.c
> index 0f36aa33d2e50..1483559600610 100644
> --- a/drivers/pci/controller/dwc/pcie-uniphier-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-uniphier-ep.c
> @@ -324,8 +324,8 @@ static int uniphier_pcie_ep_probe(struct platform_device *pdev)
>   		return PTR_ERR(priv->base);
>   
>   	priv->clk_gio = devm_clk_get(dev, "gio");
> -	if (IS_ERR(priv->clk))
> -		return PTR_ERR(priv->clk);
> +	if (IS_ERR(priv->clk_gio))
> +		return PTR_ERR(priv->clk_gio);
>   
>   	priv->rst_gio = devm_reset_control_get_shared(dev, "gio");
>   	if (IS_ERR(priv->rst_gio))
> 

Thank you for pointing out.
Certainly this is a wrong check.

Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>

Thanks,

---
Best Regards
Kunihiko Hayashi

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

* Re: [PATCH] PCI: uniphier: Fix some error handling in uniphier_pcie_ep_probe()
  2020-06-03 17:52 [PATCH] PCI: uniphier: Fix some error handling in uniphier_pcie_ep_probe() Dan Carpenter
  2020-06-04  0:39 ` Kunihiko Hayashi
@ 2020-06-04  9:07 ` Lorenzo Pieralisi
  1 sibling, 0 replies; 3+ messages in thread
From: Lorenzo Pieralisi @ 2020-06-04  9:07 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Kunihiko Hayashi, Rob Herring, Bjorn Helgaas, Masahiro Yamada,
	linux-pci, kernel-janitors

On Wed, Jun 03, 2020 at 08:52:07PM +0300, Dan Carpenter wrote:
> This code is checking the wrong variable.  It should be checking
> "clk_gio" instead of "clk".  The "priv->clk" pointer is NULL at this
> point so the condition is false.
> 
> Fixes: 006564dee8253 ("PCI: uniphier: Add Socionext UniPhier Pro5 PCIe endpoint controller driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/pci/controller/dwc/pcie-uniphier-ep.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Squashed in the commit it is fixing, thanks !

Lorenzo

> diff --git a/drivers/pci/controller/dwc/pcie-uniphier-ep.c b/drivers/pci/controller/dwc/pcie-uniphier-ep.c
> index 0f36aa33d2e50..1483559600610 100644
> --- a/drivers/pci/controller/dwc/pcie-uniphier-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-uniphier-ep.c
> @@ -324,8 +324,8 @@ static int uniphier_pcie_ep_probe(struct platform_device *pdev)
>  		return PTR_ERR(priv->base);
>  
>  	priv->clk_gio = devm_clk_get(dev, "gio");
> -	if (IS_ERR(priv->clk))
> -		return PTR_ERR(priv->clk);
> +	if (IS_ERR(priv->clk_gio))
> +		return PTR_ERR(priv->clk_gio);
>  
>  	priv->rst_gio = devm_reset_control_get_shared(dev, "gio");
>  	if (IS_ERR(priv->rst_gio))
> -- 
> 2.26.2
> 

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

end of thread, other threads:[~2020-06-04  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 17:52 [PATCH] PCI: uniphier: Fix some error handling in uniphier_pcie_ep_probe() Dan Carpenter
2020-06-04  0:39 ` Kunihiko Hayashi
2020-06-04  9:07 ` Lorenzo Pieralisi

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