Message ID | fcb34c72-89c7-9993-fc0a-ba3a61708bec@web.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | serial: bcm2835: Use devm_platform_ioremap_resource() in bcm2835aux_serial_probe() | expand |
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>
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;