phy: bcm-ns-usb2: improve printing ref clk errors
PATCH 1/1 phy: bcm-ns-usb2: improve printing ref clk errors
From: Rafał Miłecki <[email protected]>
Print actual error number to help debugging issues but also avoid printing -EPROBE_DEFER.
--- drivers/phy/broadcom/phy-bcm-ns-usb2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/phy/broadcom/phy-bcm-ns-usb2.c +6 -2
@@ -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);
Signature · 7 lines
2.31.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 15 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Print actual error number to help debugging issues but also avoid printing -EPROBE_DEFER.
Signed-off-by Rafał Miłecki <[email protected]>--- drivers/phy/broadcom/phy-bcm-ns-usb2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/phy/broadcom/phy-bcm-ns-usb2.c +0
-0
drivers/phy/broadcom/phy-bcm-ns-usb2.c static int bcm_ns_usb2_probe(struct platform_device *pdev) · line 135
Quoted 6 lines
drivers/phy/broadcom/phy-bcm-ns-usb2.c +1
-2@@ -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.
Signature · 6 lines
Florian -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v2 1/1 phy: bcm-ns-usb2: improve printing ref clk errors
In reply to Rafał MiłeckiFrom: Rafał Miłecki <[email protected]>
Improve message & use dev_err_probe() helper which prints actual error (helpful for debugging) and deals with -EPROBE_DEFER.
---
V2: Use dev_err_probe() - thank you Florian!
--- drivers/phy/broadcom/phy-bcm-ns-usb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/broadcom/phy-bcm-ns-usb2.c +1 -1
@@ -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); }
Signature · 7 lines
2.31.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 6 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
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 <[email protected]>
Signature · 6 lines
Florian -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 4 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Improve message & use
dev_err_probe()helper which prints actual error (helpful for debugging) and deals with -EPROBE_DEFER.
Applied, thanks
Signature · 6 lines
~Vinod -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy