Skip to contentSkip to conversation

usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER

PATCH Applied David Lechner 3 participants 4 messages Oct 25, 2016 – Nov 3, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER

This suppresses printing the error message "failed to get phy" in the kernel log when the error is -EPROBE_DEFER. This prevents usless noise in the kernel log.

---
 drivers/usb/musb/da8xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/musb/da8xx.c +2 -1
index 481d786..f8a1591 100644
@@ -516,7 +516,8 @@ static int da8xx_probe(struct platform_device *pdev)
 
 	glue->phy = devm_phy_get(&pdev->dev, "usb-phy");
 	if (IS_ERR(glue->phy)) {
-		dev_err(&pdev->dev, "failed to get phy\n");
+		if (PTR_ERR(glue->phy) != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "failed to get phy\n");
 		return PTR_ERR(glue->phy);
 	}
 
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

Hi,

Quoted 5 lines · David Lechner

This suppresses printing the error message "failed to get phy" in the kernel log when the error is -EPROBE_DEFER. This prevents usless noise in the kernel log.

Applied. Thanks.

Regards,
-Bin.

Quoted 21 lines
---
 drivers/usb/musb/da8xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/musb/da8xx.c +2 -1
index 481d786..f8a1591 100644
@@ -516,7 +516,8 @@ static int da8xx_probe(struct platform_device *pdev)
 
 	glue->phy = devm_phy_get(&pdev->dev, "usb-phy");
 	if (IS_ERR(glue->phy)) {
-		dev_err(&pdev->dev, "failed to get phy\n");
+		if (PTR_ERR(glue->phy) != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "failed to get phy\n");
 		return PTR_ERR(glue->phy);
 	}
 
Signature · 1 line
2.7.4
#2 lore raw
In reply to David Lechner

Hi,

Quoted 14 lines · David Lechner

This suppresses printing the error message "failed to get phy" in the kernel log when the error is -EPROBE_DEFER. This prevents usless noise in the kernel log.

---
 drivers/usb/musb/da8xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/musb/da8xx.c +0 -0
index 481d786..f8a1591 100644

drivers/usb/musb/da8xx.c static int da8xx_probe(struct platform_device *pdev) · line 520

Quoted 6 lines
drivers/usb/musb/da8xx.c +2 -1
@@ -516,7 +516,8 @@ static int da8xx_probe(struct platform_device *pdev)
 
 	glue->phy = devm_phy_get(&pdev->dev, "usb-phy");
 	if (IS_ERR(glue->phy)) {
-		dev_err(&pdev->dev, "failed to get phy\n");
+		if (PTR_ERR(glue->phy) != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "failed to get phy\n");

What about something like this?

dev_printk(PTR_ERR(glue->phy) == -EPROBE_DEFER ? KERN_DEBUG : KERN_ERR, ...

At least it outputs something if debug is enabled, making debugging easier.

ladis

Quoted 3 lines
drivers/usb/musb/da8xx.c +0 -0
 		return PTR_ERR(glue->phy);
 	}
 
maintainer
#3 lore raw
Quoted 26 lines · Ladislav Michl

Hi,

Quoted 14 lines · David Lechner

This suppresses printing the error message "failed to get phy" in the kernel log when the error is -EPROBE_DEFER. This prevents usless noise in the kernel log.

---
 drivers/usb/musb/da8xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/musb/da8xx.c +0 -0
index 481d786..f8a1591 100644

drivers/usb/musb/da8xx.c static int da8xx_probe(struct platform_device *pdev) · line 520

Quoted 6 lines
drivers/usb/musb/da8xx.c +2 -1
@@ -516,7 +516,8 @@ static int da8xx_probe(struct platform_device *pdev)
 
 	glue->phy = devm_phy_get(&pdev->dev, "usb-phy");
 	if (IS_ERR(glue->phy)) {
-		dev_err(&pdev->dev, "failed to get phy\n");
+		if (PTR_ERR(glue->phy) != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "failed to get phy\n");

What about something like this?

Quoted 3 lines

dev_printk(PTR_ERR(glue->phy) == -EPROBE_DEFER ? KERN_DEBUG : KERN_ERR, ...

At least it outputs something if debug is enabled, making debugging easier.

It is unnecessary, when probe failed, kernel prints a probe failure log with error -517, and da8xx_probe() has only this one place returning -EPROBE_DEFER.

And this change makes the code a little hard to read.

Regards,
-Bin.