[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1552602855-26086-2-git-send-email-info@metux.net>
Date: Thu, 14 Mar 2019 23:33:31 +0100
From: "Enrico Weigelt, metux IT consult" <info@...ux.net>
To: linux-kernel@...r.kernel.org
Cc: gregkh@...uxfoundation.org, eric@...olt.net,
stefan.wahren@...e.com, f.fainelli@...il.com, rjui@...adcom.com,
sbranden@...adcom.com, bcm-kernel-feedback-list@...adcom.com,
andriy.shevchenko@...ux.intel.com, vz@...ia.com,
matthias.bgg@...il.com, yamada.masahiro@...ionext.com,
tklauser@...tanz.ch, richard.genoud@...il.com,
macro@...ux-mips.org, u.kleine-koenig@...gutronix.de,
kernel@...gutronix.de, slemieux.tyco@...il.com,
andy.gross@...aro.org, david.brown@...aro.org, shawnguo@...nel.org,
s.hauer@...gutronix.de, festevam@...il.com, linux-imx@....com,
baohua@...nel.org, jacmet@...site.dk, linux-serial@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH v2 01/45] drivers: tty: serial: 8250_bcm2835aux: use devm_platform_ioremap_resource()
For the common platform_get_resource()+devm_platform_ioremap() combination,
there is a helper, so use it and make the code a bit more compact.
Signed-off-by: Enrico Weigelt, metux IT consult <info@...ux.net>
---
drivers/tty/serial/8250/8250_bcm2835aux.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index bd53661..0738d14 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 */
@@ -63,15 +62,12 @@ 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)
+ if (ret) {
+ dev_err(&pdev->dev, "could not map memory resource");
return ret;
+ }
/* Check for a fixed line number */
ret = of_alias_get_id(pdev->dev.of_node, "serial");
--
1.9.1
Powered by blists - more mailing lists