From: Greg KH <gregkh@linuxfoundation.org>
To: Arjun Sreedharan <arjun024@gmail.com>
Cc: balbi@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: phy: return -ENODEV on failure of try_module_get
Date: Sun, 17 Aug 2014 18:59:59 -0700 [thread overview]
Message-ID: <20140818015959.GC14301@kroah.com> (raw)
In-Reply-To: <1408300482-1667-1-git-send-email-arjun024@gmail.com>
On Mon, Aug 18, 2014 at 12:04:42AM +0530, Arjun Sreedharan wrote:
> When __usb_find_phy_dev() does not return error and
> try_module_get() fails, return -ENODEV
>
> Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
> ---
> drivers/usb/phy/phy.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
> index 36b6bce..8ad3638 100644
> --- a/drivers/usb/phy/phy.c
> +++ b/drivers/usb/phy/phy.c
> @@ -232,6 +232,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
> phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
> if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
> dev_dbg(dev, "unable to find transceiver\n");
> + phy = IS_ERR(phy) ? phy : ERR_PTR(-ENODEV);
Please just spell out the if () statement, don't use ? : unless
necessary.
thanks,
greg k-h
next prev parent reply other threads:[~2014-08-18 2:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-17 18:34 [PATCH] usb: phy: return -ENODEV on failure of try_module_get Arjun Sreedharan
2014-08-18 1:59 ` Greg KH [this message]
2014-08-18 5:47 ` Arjun Sreedharan
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=20140818015959.GC14301@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arjun024@gmail.com \
--cc=balbi@ti.com \
--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.