From: Felipe Balbi <balbi@ti.com>
To: Arjun Sreedharan <arjun024@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb:phy: propagate __of_usb_find_phy()'s error on failure
Date: Thu, 20 Nov 2014 13:39:49 -0600 [thread overview]
Message-ID: <20141120193949.GC23217@saruman> (raw)
In-Reply-To: <1416498816-3292-1-git-send-email-arjun024@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
On Thu, Nov 20, 2014 at 09:23:36PM +0530, Arjun Sreedharan wrote:
> When __of_usb_find_phy() fails, it returns -ENODEV - its
> error code has to be returned by devm_usb_get_phy_by_phandle().
> Only when the former function succeeds and try_module_get()
> fails should -EPROBE_DEFER be returned.
>
> Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
> ---
> drivers/usb/phy/phy.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
> index 045cd30..0310112 100644
> --- a/drivers/usb/phy/phy.c
> +++ b/drivers/usb/phy/phy.c
> @@ -191,7 +191,9 @@ struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
>
> phy = __of_usb_find_phy(node);
> if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
> - phy = ERR_PTR(-EPROBE_DEFER);
> + if (!IS_ERR(phy))
> + phy = ERR_PTR(-EPROBE_DEFER);
> +
trailing whitespace here. I'll fix it myself this time, but next time be
more careful.
cheers
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-11-20 19:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 15:53 [PATCH] usb:phy: propagate __of_usb_find_phy()'s error on failure Arjun Sreedharan
2014-11-20 19:39 ` Felipe Balbi [this message]
[not found] ` <CAJFMrCGbUQar751mOZOJ5Fy=HEDb+L7XjQypJxzyE72T=qoDmw@mail.gmail.com>
2014-11-21 15:03 ` Felipe Balbi
2014-11-24 13:10 ` Thierry Reding
2014-11-24 14:36 ` Felipe Balbi
2014-11-24 14:36 ` Felipe Balbi
2014-11-24 15:16 ` Thierry Reding
2014-11-24 15:36 ` Felipe Balbi
2014-11-24 15:36 ` Felipe Balbi
2014-11-24 15:37 ` Felipe Balbi
2014-11-24 15:37 ` Felipe Balbi
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=20141120193949.GC23217@saruman \
--to=balbi@ti.com \
--cc=arjun024@gmail.com \
--cc=gregkh@linuxfoundation.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 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.