]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: musb-new: sunxi: fix error check
authorSam Edwards <cfsworks@gmail.com>
Mon, 5 Jun 2023 17:19:37 +0000 (11:19 -0600)
committerMarek Vasut <marex@denx.de>
Wed, 7 Jun 2023 21:38:51 +0000 (23:38 +0200)
The `musb_register` function returns some ERR_PTR(...) on failure,
not NULL, so update the check here appropriately.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
drivers/usb/musb-new/sunxi.c

index dc4cfc2194b4920a5b99cfbb55d19324a5839de0..dac98aec1ee6fc89283ac5cae4728a338a4a1bb8 100644 (file)
@@ -486,7 +486,7 @@ static int musb_usb_probe(struct udevice *dev)
 #else
        pdata.mode = MUSB_PERIPHERAL;
        host->host = musb_register(&pdata, &glue->dev, base);
-       if (!host->host)
+       if (IS_ERR_OR_NULL(host->host))
                return -EIO;
 
        printf("Allwinner mUSB OTG (Peripheral)\n");