aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/common
diff options
context:
space:
mode:
authorChunfeng Yun2021-05-19 14:39:45 +0800
committerGreg Kroah-Hartman2021-05-21 14:09:54 +0200
commitddaf0d6dc4671e88c72227fad68ecc45e7274559 (patch)
tree92952e84f8d6f616d821238ac4fe3a53e79f3cb2 /drivers/usb/common
parent880287910b1892ed2cb38977893b947382a09d21 (diff)
usb: common: usb-conn-gpio: use dev_err_probe() to print log
Use dev_err_probe() to print debug or error message depending on whether the error value is -DPROBE_DEFER or not. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/1621406386-18838-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/common')
-rw-r--r--drivers/usb/common/usb-conn-gpio.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
index c9545a4eff66..dfbbc4f51ed6 100644
--- a/drivers/usb/common/usb-conn-gpio.c
+++ b/drivers/usb/common/usb-conn-gpio.c
@@ -223,18 +223,14 @@ static int usb_conn_probe(struct platform_device *pdev)
}
if (IS_ERR(info->vbus)) {
- if (PTR_ERR(info->vbus) != -EPROBE_DEFER)
- dev_err(dev, "failed to get vbus: %ld\n", PTR_ERR(info->vbus));
- return PTR_ERR(info->vbus);
+ ret = PTR_ERR(info->vbus);
+ return dev_err_probe(dev, ret, "failed to get vbus :%d\n", ret);
}
info->role_sw = usb_role_switch_get(dev);
- if (IS_ERR(info->role_sw)) {
- if (PTR_ERR(info->role_sw) != -EPROBE_DEFER)
- dev_err(dev, "failed to get role switch\n");
-
- return PTR_ERR(info->role_sw);
- }
+ if (IS_ERR(info->role_sw))
+ return dev_err_probe(dev, PTR_ERR(info->role_sw),
+ "failed to get role switch\n");
ret = usb_conn_psy_register(info);
if (ret)