Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966067Ab3DQIMz (ORCPT ); Wed, 17 Apr 2013 04:12:55 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:33979 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965860Ab3DQIMw (ORCPT ); Wed, 17 Apr 2013 04:12:52 -0400 Message-ID: <516E597B.9010100@ti.com> Date: Wed, 17 Apr 2013 11:12:43 +0300 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: Alan Stern CC: , , , , , , "ABRAHAM, KISHON VIJAY" Subject: Re: [PATCH 2/2] USB: ehci-omap: Improve PHY error handling References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2219 Lines: 57 On 04/16/2013 06:32 PM, Alan Stern wrote: > On Mon, 15 Apr 2013, Roger Quadros wrote: > >> As the USB PHY layer never returns NULL we don't need >> to check for that condition. >> >> If we fail to get the PHY device it could be due >> to missing USB PHY drivers. Give this hint to the user >> in the error message. >> >> CC: Alan Stern >> Signed-off-by: Roger Quadros >> --- >> drivers/usb/host/ehci-omap.c | 6 +++--- >> 1 files changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c >> index 5de3e43..2e34ddd 100644 >> --- a/drivers/usb/host/ehci-omap.c >> +++ b/drivers/usb/host/ehci-omap.c >> @@ -175,13 +175,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) >> phy = devm_usb_get_phy_by_phandle(dev, "phys", i); >> else >> phy = devm_usb_get_phy_dev(dev, i); >> - if (IS_ERR(phy) || !phy) { >> + if (IS_ERR(phy)) { >> /* Don't bail out if PHY is not absolutely necessary */ >> if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) >> continue; >> >> - ret = IS_ERR(phy) ? PTR_ERR(phy) : -ENODEV; >> - dev_err(dev, "Can't get PHY device for port %d: %d\n", >> + ret = PTR_ERR(phy); >> + dev_err(dev, "Can't get PHY device for port %d: %d. Is USB_PHY driver enabled?\n", >> i, ret); >> goto err_phy; >> } > > Getting rid of the !phy test is good. But I'm doubtful about the > change to the error message. Are you going to make a similar change to > every platform driver? There doesn't seem to be any reason to do this > for ehci-omap but not the others. I'm not very sure about that. If using the PHY API while USB_PHY is disabled is to be treated as a universal failure, then the print might as well come from the dummy stub for xx_usb_get_phy_xx(). For this patch, I'll just undo the print message change and resend. That could be done in a separate patch instead. cheers, -roger -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/