[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140818015959.GC14301@kroah.com>
Date: Sun, 17 Aug 2014 18:59:59 -0700
From: Greg KH <gregkh@...uxfoundation.org>
To: Arjun Sreedharan <arjun024@...il.com>
Cc: balbi@...com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: phy: return -ENODEV on failure of try_module_get
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists