Skip to content

Commit

Permalink
usb: phy: propagate __of_usb_find_phy()'s error on failure
Browse files Browse the repository at this point in the history
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.

[ [email protected] : remove trailing whitespace ]

Signed-off-by: Arjun Sreedharan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
arjun024 authored and Felipe Balbi committed Nov 20, 2014
1 parent 62c6069 commit 1290a95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

devres_free(ptr);
goto err1;
}
Expand Down

0 comments on commit 1290a95

Please sign in to comment.