diff mbox

[U-Boot,1/4] sunxi: musb: Return early on VBUS GPIO error instead of on a positive value

Message ID 1426440467-4525-1-git-send-email-contact@paulk.fr
State Superseded
Delegated to: Hans de Goede
Headers show

Commit Message

Paul Kocialkowski March 15, 2015, 5:27 p.m. UTC
This allows printing the error message when VBUS is detected, as it would with
AXP VBUS detect.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
 drivers/usb/musb-new/sunxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans de Goede March 21, 2015, 12:56 p.m. UTC | #1
Hi,

On 15-03-15 18:27, Paul Kocialkowski wrote:
> This allows printing the error message when VBUS is detected, as it would with
> AXP VBUS detect.
>
> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> ---
>   drivers/usb/musb-new/sunxi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
> index 4d8c15a..90aaec6 100644
> --- a/drivers/usb/musb-new/sunxi.c
> +++ b/drivers/usb/musb-new/sunxi.c
> @@ -261,7 +261,7 @@ static int sunxi_musb_init(struct musb *musb)
>   			}
>
>   			err = gpio_get_value(vbus_det);
> -			if (err) {
> +			if (err < 0) {
>   				gpio_free(vbus_det);
>   				return -EIO;
>   			}
>

Good catch, thanks I've send a pull-req with this fix upstream,
please base your next patch-set on u-boot-sunxi/master, or
at least keep this patch as a base before doing the axp gpio
cleanups I asked for in my previous mail.

Regards,

Hans
diff mbox

Patch

diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 4d8c15a..90aaec6 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -261,7 +261,7 @@  static int sunxi_musb_init(struct musb *musb)
 			}
 
 			err = gpio_get_value(vbus_det);
-			if (err) {
+			if (err < 0) {
 				gpio_free(vbus_det);
 				return -EIO;
 			}