serial: vt8500_serial: Convert to devm_ioremap_resource()
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 4 Mar 2013 08:54:39 +0000 (14:24 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 20:55:23 +0000 (13:55 -0700)
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/vt8500_serial.c

index a3f9dd5c9dff40dacf86966ae3d6ff1335055f97..f15f53f18ca99e2b37ef41ffe32429aa3ea381fa 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
+#include <linux/err.h>
 
 /*
  * UART Register offsets
@@ -585,9 +586,9 @@ static int vt8500_serial_probe(struct platform_device *pdev)
        if (!vt8500_port)
                return -ENOMEM;
 
-       vt8500_port->uart.membase = devm_request_and_ioremap(&pdev->dev, mmres);
-       if (!vt8500_port->uart.membase)
-               return -EADDRNOTAVAIL;
+       vt8500_port->uart.membase = devm_ioremap_resource(&pdev->dev, mmres);
+       if (IS_ERR(vt8500_port->uart.membase))
+               return PTR_ERR(vt8500_port->uart.membase);
 
        vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
        if (IS_ERR(vt8500_port->clk)) {