[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130314140832.GH26080@arwen.pp.htv.fi>
Date: Thu, 14 Mar 2013 16:08:32 +0200
From: Felipe Balbi <balbi@...com>
To: Alan Stern <stern@...land.harvard.edu>
CC: Roger Quadros <rogerq@...com>, Felipe Balbi <balbi@...com>,
<gregkh@...uxfoundation.org>, <b-cousson@...com>,
<mark.rutland@....com>,
Kernel development list <linux-kernel@...r.kernel.org>,
USB list <linux-usb@...r.kernel.org>,
<linux-omap@...r.kernel.org>, <devicetree-discuss@...ts.ozlabs.org>
Subject: Re: [PATCH 11/12] USB: ehci-omap: Try to get PHY even if not in PHY
mode
On Tue, Mar 12, 2013 at 11:57:56AM -0400, Alan Stern wrote:
> On Tue, 12 Mar 2013, Roger Quadros wrote:
>
> > Even when not in PHY mode, the USB device on the port (e.g. HUB)
> > might need resources like RESET which can be modelled as a PHY
> > device. So try to get the PHY device in any case.
> >
> > Signed-off-by: Roger Quadros <rogerq@...com>
> > CC: Alan Stern <stern@...land.harvard.edu>
>
> Acked-by: Alan Stern <stern@...land.harvard.edu>
>
> > /* get the PHY device */
> > if (dev->of_node)
> > phy = devm_usb_get_phy_by_phandle(dev, "phys", i);
> > else
> > phy = devm_usb_get_phy_dev(dev, i);
> > if (IS_ERR(phy) || !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",
> > i, ret);
>
> Felipe, this is a strange interface. Why do we sometimes get an
> error-pointer and sometimes get just NULL? Why not always an
> error-pointer?
looks like we get NULL when PHY layer is disabled. Sounds like an
oversight to me. Do you want to send a patch, or do I cook one and put
yourself as Reported-by ?
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists