linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: bcm2835: Use devm_platform_ioremap_resource() in bcm2835aux_serial_probe()
@ 2019-09-18 20:12 Markus Elfring
  2019-09-20 17:51 ` Florian Fainelli
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-18 20:12 UTC (permalink / raw)
  To: linux-serial, linux-rpi-kernel, linux-arm-kernel,
	bcm-kernel-feedback-list, Eric Anholt, Florian Fainelli,
	Greg Kroah-Hartman, Jiri Slaby, Martin Sperl, Ray Jui,
	Scott Branden, Stefan Wahren, Stephen Boyd
  Cc: LKML, kernel-janitors, Bartosz Golaszewski, Himanshu Jha

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: bcm2835: Use devm_platform_ioremap_resource() in bcm2835aux_serial_probe()
  2019-09-18 20:12 [PATCH] serial: bcm2835: Use devm_platform_ioremap_resource() in bcm2835aux_serial_probe() Markus Elfring
@ 2019-09-20 17:51 ` Florian Fainelli
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2019-09-20 17:51 UTC (permalink / raw)
  To: Markus Elfring, linux-serial, linux-rpi-kernel, linux-arm-kernel,
	bcm-kernel-feedback-list, Eric Anholt, Florian Fainelli,
	Greg Kroah-Hartman, Jiri Slaby, Martin Sperl, Ray Jui,
	Scott Branden, Stefan Wahren, Stephen Boyd
  Cc: LKML, kernel-janitors, Bartosz Golaszewski, Himanshu Jha

On 9/18/19 1:12 PM, Markus Elfring wrote:
> 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>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-20 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 20:12 [PATCH] serial: bcm2835: Use devm_platform_ioremap_resource() in bcm2835aux_serial_probe() Markus Elfring
2019-09-20 17:51 ` Florian Fainelli

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).