From: Markus Elfring <Markus.Elfring@web.de>
To: linux-serial@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
bcm-kernel-feedback-list@broadcom.com,
Eric Anholt <eric@anholt.net>,
Florian Fainelli <f.fainelli@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Martin Sperl <kernel@martin.sperl.org>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Stefan Wahren <wahrenst@gmx.net>,
Stephen Boyd <swboyd@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Himanshu Jha <himanshujha199640@gmail.com>
Subject: [PATCH] serial: bcm2835: Use devm_platform_ioremap_resource() in bcm2835aux_serial_probe()
Date: Wed, 18 Sep 2019 22:12:40 +0200 [thread overview]
Message-ID: <fcb34c72-89c7-9993-fc0a-ba3a61708bec@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 18 Sep 2019 22:00:14 +0200
Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/8250/8250_bcm2835aux.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index 8ce700c1a7fc..e2c9d19fc8e9 100644
--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -25,7 +25,6 @@ struct bcm2835aux_data {
static int bcm2835aux_serial_probe(struct platform_device *pdev)
{
struct bcm2835aux_data *data;
- struct resource *res;
int ret;
/* allocate the custom structure */
@@ -61,12 +60,7 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
data->uart.port.irq = ret;
/* map the main registers */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pdev->dev, "memory resource not found");
- return -EINVAL;
- }
- data->uart.port.membase = devm_ioremap_resource(&pdev->dev, res);
+ data->uart.port.membase = devm_platform_ioremap_resource(pdev, 0);
ret = PTR_ERR_OR_ZERO(data->uart.port.membase);
if (ret)
return ret;
--
2.23.0
next reply other threads:[~2019-09-18 20:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 20:12 Markus Elfring [this message]
2019-09-20 17:51 ` [PATCH] serial: bcm2835: Use devm_platform_ioremap_resource() in bcm2835aux_serial_probe() Florian Fainelli
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=fcb34c72-89c7-9993-fc0a-ba3a61708bec@web.de \
--to=markus.elfring@web.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bgolaszewski@baylibre.com \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=himanshujha199640@gmail.com \
--cc=jslaby@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernel@martin.sperl.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=swboyd@chromium.org \
--cc=wahrenst@gmx.net \
/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;
as well as URLs for NNTP newsgroup(s).