Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758392AbcKCPnW (ORCPT ); Thu, 3 Nov 2016 11:43:22 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:58545 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758330AbcKCPnO (ORCPT ); Thu, 3 Nov 2016 11:43:14 -0400 Date: Thu, 3 Nov 2016 10:42:17 -0500 From: Bin Liu To: Ladislav Michl CC: David Lechner , Greg Kroah-Hartman , Alexandre Bailon , , Subject: Re: [PATCH] usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER Message-ID: <20161103154217.GA13361@uda0271908> Mail-Followup-To: Bin Liu , Ladislav Michl , David Lechner , Greg Kroah-Hartman , Alexandre Bailon , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <1477422170-1490-1-git-send-email-david@lechnology.com> <20161102214559.GA2338@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161102214559.GA2338@localhost.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1394 Lines: 39 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 > > --- > > 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.