diff mbox series

[2/2] usb: common: usb-conn-gpio: Print error on failure to get VBUS

Message ID 20200806160248.3936771-2-thierry.reding@gmail.com
State Deferred
Headers show
Series [1/2] usb: common: usb-conn-gpio: Make VBUS supply optional | expand

Commit Message

Thierry Reding Aug. 6, 2020, 4:02 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

The exact error that happened trying to get the VBUS supply can be
useful to troubleshoot what's going on.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/usb/common/usb-conn-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michał Mirosław Aug. 8, 2020, 3:01 a.m. UTC | #1
On Thu, Aug 06, 2020 at 06:02:48PM +0200, Thierry Reding wrote:
> The exact error that happened trying to get the VBUS supply can be
> useful to troubleshoot what's going on.
[...]
> --- a/drivers/usb/common/usb-conn-gpio.c
> +++ b/drivers/usb/common/usb-conn-gpio.c
> @@ -206,7 +206,7 @@ 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\n");
> +			dev_err(dev, "failed to get vbus: %ld\n", PTR_ERR(info->vbus));

There is now a nice "%pe" format, that can make this even better.

Best Regards,
Michał Mirosław
diff mbox series

Patch

diff --git a/drivers/usb/common/usb-conn-gpio.c b/drivers/usb/common/usb-conn-gpio.c
index c5b516d327c7..6c4e3a19f42c 100644
--- a/drivers/usb/common/usb-conn-gpio.c
+++ b/drivers/usb/common/usb-conn-gpio.c
@@ -206,7 +206,7 @@  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\n");
+			dev_err(dev, "failed to get vbus: %ld\n", PTR_ERR(info->vbus));
 		return PTR_ERR(info->vbus);
 	}