From: Dan Carpenter <dan.carpenter@oracle.com>
To: Al Cooper <alcooperx@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Florian Fainelli <f.fainelli@gmail.com>,
bcm-kernel-feedback-list@broadcom.com, linux-usb@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] usb: misc: brcmstb-usb-pinmap: Fix an IS_ERR() vs NULL check
Date: Mon, 2 Nov 2020 10:56:55 +0300 [thread overview]
Message-ID: <20201102075655.GA4163205@mwanda> (raw)
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>
---
The commit original commit "usb: Add driver to allow any GPIO to ..."
has a bad subsystem prefix. This is a common anti-pattern for new
drivers. (Although less common after I started whinging to everyone
about it). It means that the first person to fix a bug in the driver
has to imagine what the original author wanted. Sometimes people get
annoyed which prefix we pick for them.
drivers/usb/misc/brcmstb-usb-pinmap.c | 4 ++--
1 file 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);
--
2.28.0
next reply other threads:[~2020-11-02 7:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 7:56 Dan Carpenter [this message]
2020-11-03 19:53 ` [PATCH] usb: misc: brcmstb-usb-pinmap: Fix an IS_ERR() vs NULL check Alan Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201102075655.GA4163205@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alcooperx@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox