All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <Peter.Chen@freescale.com>
To: linux-sh@vger.kernel.org
Subject: RE: [RFC V2 PATCH 2/2] usb: hcd: Initialize USB phy if needed
Date: Fri, 08 Nov 2013 01:44:38 +0000	[thread overview]
Message-ID: <F281D0F91ED19E4D8E63A7504E8A6498040EBD5C@039-SN2MPN1-021.039d.mgd.msft.net> (raw)
In-Reply-To: <1383822869-20283-3-git-send-email-valentine.barshak@cogentembedded.com>


 
> >>
> >> +#ifdef CONFIG_USB_PHY
> >> +	if (!hcd->phy) {
> >> +		struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller,
> >> 0);
> >> +
> >> +		if (IS_ERR(phy)) {
> >> +			retval = PTR_ERR(phy);
> >> +			if (retval = -EPROBE_DEFER)
> >> +				return retval;
> >> +		} else {
> >> +			retval = usb_phy_init(phy);
> >> +			if (retval) {
> >> +				usb_put_phy(phy);
> >> +				return retval;
> >> +			}
> >> +			hcd->phy = phy;
> >> +			hcd->remove_phy = 1;
> >> +		}
> >> +	}
> >> +#endif
> >> +
> >
> > If the platform doesn't has phy driver, and with CONFIG_USB_PHY enabled,
> it
> > will have problem for above code.
> >
> 
> It shouldn't have any problems since there's no phy bound to the HCD in
> this case.
> Thus, usb_get_phy_dev returns -ENODEV and the HCD will be added as usual.
> 
Yes, my fault. The retval will be override later.

Peter



      parent reply	other threads:[~2013-11-08  1:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 11:14 [RFC V2 PATCH 2/2] usb: hcd: Initialize USB phy if needed Valentine Barshak
2013-11-07 13:06 ` Peter Chen
2013-11-07 14:50 ` Valentine
2013-11-07 15:18 ` Alan Stern
2013-11-08  1:44 ` Peter Chen [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=F281D0F91ED19E4D8E63A7504E8A6498040EBD5C@039-SN2MPN1-021.039d.mgd.msft.net \
    --to=peter.chen@freescale.com \
    --cc=linux-sh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.