Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1514153 > unrolled thread
| Started by | Ladislav Michl <ladis@linux-mips.org> |
|---|---|
| First post | 2016-11-02 22:50 +0100 |
| Last post | 2016-11-03 16:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER Ladislav Michl <ladis@linux-mips.org> - 2016-11-02 22:50 +0100
Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER Bin Liu <b-liu@ti.com> - 2016-11-03 16:50 +0100
| From | Ladislav Michl <ladis@linux-mips.org> |
|---|---|
| Date | 2016-11-02 22:50 +0100 |
| Subject | Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER |
| Message-ID | <szbzY-3hO-19@gated-at.bofh.it> |
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);
> }
>
[toc] | [next] | [standalone]
| From | Bin Liu <b-liu@ti.com> |
|---|---|
| Date | 2016-11-03 16:50 +0100 |
| Message-ID | <szsr8-5Iy-33@gated-at.bofh.it> |
| In reply to | #1514153 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web