提交 1290a958 编写于 作者: A Arjun Sreedharan 提交者: Felipe Balbi

usb: phy: propagate __of_usb_find_phy()'s error on failure

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.

[ balbi@ti.com : remove trailing whitespace ]
Signed-off-by: NArjun Sreedharan <arjun024@gmail.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 62c60697
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册