* [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
@ 2016-10-25 19:02 David Lechner
2016-11-01 19:44 ` Bin Liu
2016-11-02 21:45 ` Ladislav Michl
0 siblings, 2 replies; 4+ messages in thread
From: David Lechner @ 2016-10-25 19:02 UTC (permalink / raw)
To: Bin Liu
Cc: David Lechner, Greg Kroah-Hartman, Alexandre Bailon, linux-usb,
linux-kernel
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 <david@lechnology.com>
---
drivers/usb/musb/da8xx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 481d786..f8a1591 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -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);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
2016-10-25 19:02 [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER David Lechner
@ 2016-11-01 19:44 ` Bin Liu
2016-11-02 21:45 ` Ladislav Michl
1 sibling, 0 replies; 4+ messages in thread
From: Bin Liu @ 2016-11-01 19:44 UTC (permalink / raw)
To: David Lechner
Cc: Greg Kroah-Hartman, Alexandre Bailon, linux-usb, linux-kernel
Hi,
On Tue, Oct 25, 2016 at 02:02:50PM -0500, David Lechner wrote:
> 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 <david@lechnology.com>
Applied. Thanks.
Regards,
-Bin.
> ---
> drivers/usb/musb/da8xx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
> index 481d786..f8a1591 100644
> --- a/drivers/usb/musb/da8xx.c
> +++ b/drivers/usb/musb/da8xx.c
> @@ -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);
> }
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
2016-10-25 19:02 [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER David Lechner
2016-11-01 19:44 ` Bin Liu
@ 2016-11-02 21:45 ` Ladislav Michl
2016-11-03 15:42 ` Bin Liu
1 sibling, 1 reply; 4+ messages in thread
From: Ladislav Michl @ 2016-11-02 21:45 UTC (permalink / raw)
To: David Lechner
Cc: Bin Liu, Greg Kroah-Hartman, Alexandre Bailon, linux-usb, linux-kernel
Hi,
On Tue, Oct 25, 2016 at 02:02:50PM -0500, David Lechner wrote:
> 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 <david@lechnology.com>
> ---
> drivers/usb/musb/da8xx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
> index 481d786..f8a1591 100644
> --- a/drivers/usb/musb/da8xx.c
> +++ b/drivers/usb/musb/da8xx.c
> @@ -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
> return PTR_ERR(glue->phy);
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
2016-11-02 21:45 ` Ladislav Michl
@ 2016-11-03 15:42 ` Bin Liu
0 siblings, 0 replies; 4+ messages in thread
From: Bin Liu @ 2016-11-03 15:42 UTC (permalink / raw)
To: Ladislav Michl
Cc: David Lechner, Greg Kroah-Hartman, Alexandre Bailon, linux-usb,
linux-kernel
On Wed, Nov 02, 2016 at 10:45:59PM +0100, Ladislav Michl wrote:
> Hi,
>
> On Tue, Oct 25, 2016 at 02:02:50PM -0500, David Lechner wrote:
> > 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 <david@lechnology.com>
> > ---
> > drivers/usb/musb/da8xx.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
> > index 481d786..f8a1591 100644
> > --- a/drivers/usb/musb/da8xx.c
> > +++ b/drivers/usb/musb/da8xx.c
> > @@ -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.
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-03 15:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 19:02 [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER David Lechner
2016-11-01 19:44 ` Bin Liu
2016-11-02 21:45 ` Ladislav Michl
2016-11-03 15:42 ` Bin Liu
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).