usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
Subsystems (2)
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
@@ -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
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.
Signed-off-by David Lechner <[email protected]>
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@@ -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
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.
Signed-off-by David Lechner <[email protected]>--- drivers/usb/musb/da8xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/usb/musb/da8xx.c +0
-0
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
-0return PTR_ERR (glue->phy); }
Bin Liu
maintainerQuoted 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.
Signed-off-by David Lechner <[email protected]>--- drivers/usb/musb/da8xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/usb/musb/da8xx.c +0
-0drivers/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.