summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/brcmstb-usb-pinmap.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-11-02 08:56:55 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-03 10:09:23 +0100
commit35ad0d901eac56ac6af2e4d726f255486c1ee36c (patch)
treef7ef39c1365d4dc9449c24294113beab042b098b /drivers/usb/misc/brcmstb-usb-pinmap.c
parentMerge 5.10-rc2 into usb-next (diff)
downloadlinux-35ad0d901eac56ac6af2e4d726f255486c1ee36c.tar.xz
linux-35ad0d901eac56ac6af2e4d726f255486c1ee36c.zip
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 <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20201102075655.GA4163205@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/brcmstb-usb-pinmap.c')
-rw-r--r--drivers/usb/misc/brcmstb-usb-pinmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/misc/brcmstb-usb-pinmap.c b/drivers/usb/misc/brcmstb-usb-pinmap.c
index 02144c39aaba..2326e60545f7 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);