From: Dan Carpenter Date: Mon, 2 Nov 2020 07:56:55 +0000 (+0300) Subject: usb: misc: brcmstb-usb-pinmap: Fix an IS_ERR() vs NULL check X-Git-Tag: v5.15~2220^2~94 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35ad0d901eac56ac6af2e4d726f255486c1ee36c;p=platform%2Fkernel%2Flinux-starfive.git usb: misc: brcmstb-usb-pinmap: Fix an IS_ERR() vs NULL check The devm_ioremap() function doesn't return error pointers, it returns NULL on error. Fixes: 517c4c44b323 ("usb: Add driver to allow any GPIO to be used for 7211 USB signals") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20201102075655.GA4163205@mwanda Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/brcmstb-usb-pinmap.c b/drivers/usb/misc/brcmstb-usb-pinmap.c index 02144c3..2326e60 100644 --- a/drivers/usb/misc/brcmstb-usb-pinmap.c +++ b/drivers/usb/misc/brcmstb-usb-pinmap.c @@ -277,8 +277,8 @@ static int __init brcmstb_usb_pinmap_probe(struct platform_device *pdev) pdata->out_pins = (struct out_pin *)(pdata->in_pins + in_count); pdata->regs = devm_ioremap(&pdev->dev, r->start, resource_size(r)); - if (IS_ERR(pdata->regs)) - return PTR_ERR(pdata->regs); + if (!pdata->regs) + return -ENOMEM; platform_set_drvdata(pdev, pdata); err = parse_pins(&pdev->dev, dn, pdata);