summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-10-11 09:01:03 +0200
committerFelipe Balbi <balbi@ti.com>2013-10-11 13:50:38 -0500
commit7f4d1e7bdd9f293a522e5559f1b64a95c066c15e (patch)
tree164b9af202a640f539fbba1f8bc3712b4ba3871a
parentcd1086913ffef6d9656efdf35168b2b28675c245 (diff)
downloadop-kernel-dev-7f4d1e7bdd9f293a522e5559f1b64a95c066c15e.zip
op-kernel-dev-7f4d1e7bdd9f293a522e5559f1b64a95c066c15e.tar.gz
usb: phy: don't return with NULL from devm_usb_get_phy()
The callers are expecting an ERR_PTR value in case of an error. Change he code to return with an encoded -ENOMEM value in the case of a failed devres_alloc call. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/phy/phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index a9984c7..1b74523 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -98,7 +98,7 @@ struct usb_phy *devm_usb_get_phy(struct device *dev, enum usb_phy_type type)
ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
- return NULL;
+ return ERR_PTR(-ENOMEM);
phy = usb_get_phy(type);
if (!IS_ERR(phy)) {
OpenPOWER on IntegriCloud