All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: bcm-ns-usb2: improve printing ref clk errors
@ 2021-11-23  9:48 Rafał Miłecki
  2021-11-23 19:04 ` Florian Fainelli
  2021-11-23 22:15 ` [PATCH V2] " Rafał Miłecki
  0 siblings, 2 replies; 5+ messages in thread
From: Rafał Miłecki @ 2021-11-23  9:48 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul
  Cc: linux-phy, Florian Fainelli, bcm-kernel-feedback-list,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Print actual error number to help debugging issues but also avoid
printing -EPROBE_DEFER.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/phy/broadcom/phy-bcm-ns-usb2.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
index 98d32729a45d..4cb70785ccb4 100644
--- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c
+++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
@@ -132,8 +132,12 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
 
 	usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
 	if (IS_ERR(usb2->ref_clk)) {
-		dev_err(dev, "Clock not defined\n");
-		return PTR_ERR(usb2->ref_clk);
+		int err = PTR_ERR(usb2->ref_clk);
+
+		if (err != -EPROBE_DEFER)
+			dev_err(dev, "Failed to get ref clk: %d\n", err);
+
+		return err;
 	}
 
 	usb2->phy = devm_phy_create(dev, NULL, &ops);
-- 
2.31.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH] phy: bcm-ns-usb2: improve printing ref clk errors
  2021-11-23  9:48 [PATCH] phy: bcm-ns-usb2: improve printing ref clk errors Rafał Miłecki
@ 2021-11-23 19:04 ` Florian Fainelli
  2021-11-23 22:15 ` [PATCH V2] " Rafał Miłecki
  1 sibling, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2021-11-23 19:04 UTC (permalink / raw)
  To: Rafał Miłecki, Kishon Vijay Abraham I, Vinod Koul
  Cc: linux-phy, bcm-kernel-feedback-list, Rafał Miłecki

On 11/23/21 1:48 AM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Print actual error number to help debugging issues but also avoid
> printing -EPROBE_DEFER.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  drivers/phy/broadcom/phy-bcm-ns-usb2.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
> index 98d32729a45d..4cb70785ccb4 100644
> --- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c
> +++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
> @@ -132,8 +132,12 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
>  
>  	usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
>  	if (IS_ERR(usb2->ref_clk)) {
> -		dev_err(dev, "Clock not defined\n");
> -		return PTR_ERR(usb2->ref_clk);
> +		int err = PTR_ERR(usb2->ref_clk);

dev_err_probe() should take care of that for you already.
-- 
Florian

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH V2] phy: bcm-ns-usb2: improve printing ref clk errors
  2021-11-23  9:48 [PATCH] phy: bcm-ns-usb2: improve printing ref clk errors Rafał Miłecki
  2021-11-23 19:04 ` Florian Fainelli
@ 2021-11-23 22:15 ` Rafał Miłecki
  2021-11-23 22:18   ` Florian Fainelli
  2021-11-25  5:15   ` Vinod Koul
  1 sibling, 2 replies; 5+ messages in thread
From: Rafał Miłecki @ 2021-11-23 22:15 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul
  Cc: linux-phy, Florian Fainelli, bcm-kernel-feedback-list,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Improve message & use dev_err_probe() helper which prints actual error
(helpful for debugging) and deals with -EPROBE_DEFER.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
V2: Use dev_err_probe() - thank you Florian!
---
 drivers/phy/broadcom/phy-bcm-ns-usb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
index 98d32729a45d..6a36e187d100 100644
--- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c
+++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
@@ -132,7 +132,7 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
 
 	usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
 	if (IS_ERR(usb2->ref_clk)) {
-		dev_err(dev, "Clock not defined\n");
+		dev_err_probe(dev, PTR_ERR(usb2->ref_clk), "failed to get ref clk\n");
 		return PTR_ERR(usb2->ref_clk);
 	}
 
-- 
2.31.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH V2] phy: bcm-ns-usb2: improve printing ref clk errors
  2021-11-23 22:15 ` [PATCH V2] " Rafał Miłecki
@ 2021-11-23 22:18   ` Florian Fainelli
  2021-11-25  5:15   ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2021-11-23 22:18 UTC (permalink / raw)
  To: Rafał Miłecki, Kishon Vijay Abraham I, Vinod Koul
  Cc: linux-phy, bcm-kernel-feedback-list, Rafał Miłecki

On 11/23/21 2:15 PM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Improve message & use dev_err_probe() helper which prints actual error
> (helpful for debugging) and deals with -EPROBE_DEFER.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH V2] phy: bcm-ns-usb2: improve printing ref clk errors
  2021-11-23 22:15 ` [PATCH V2] " Rafał Miłecki
  2021-11-23 22:18   ` Florian Fainelli
@ 2021-11-25  5:15   ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2021-11-25  5:15 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Kishon Vijay Abraham I, linux-phy, Florian Fainelli,
	bcm-kernel-feedback-list, Rafał Miłecki

On 23-11-21, 23:15, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Improve message & use dev_err_probe() helper which prints actual error
> (helpful for debugging) and deals with -EPROBE_DEFER.

Applied, thanks

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

end of thread, other threads:[~2021-11-25  5:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23  9:48 [PATCH] phy: bcm-ns-usb2: improve printing ref clk errors Rafał Miłecki
2021-11-23 19:04 ` Florian Fainelli
2021-11-23 22:15 ` [PATCH V2] " Rafał Miłecki
2021-11-23 22:18   ` Florian Fainelli
2021-11-25  5:15   ` Vinod Koul

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.