From: Bin Liu <b-liu@ti.com>
To: Ladislav Michl <ladis@linux-mips.org>
Cc: David Lechner <david@lechnology.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexandre Bailon <abailon@baylibre.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER
Date: Thu, 3 Nov 2016 10:42:17 -0500 [thread overview]
Message-ID: <20161103154217.GA13361@uda0271908> (raw)
In-Reply-To: <20161102214559.GA2338@localhost.localdomain>
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.
prev parent reply other threads:[~2016-11-03 15:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161103154217.GA13361@uda0271908 \
--to=b-liu@ti.com \
--cc=abailon@baylibre.com \
--cc=david@lechnology.com \
--cc=gregkh@linuxfoundation.org \
--cc=ladis@linux-mips.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).