char: xillybus: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 16 Oct 2019 09:25:46 +0000 (17:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Nov 2019 17:29:21 +0000 (18:29 +0100)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Eli Billauer <eli.billauer@gmail.com>
Link: https://lore.kernel.org/r/20191016092546.26332-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/xillybus/xillybus_of.c

index bfafd8f..96b6de8 100644 (file)
@@ -116,7 +116,6 @@ static int xilly_drv_probe(struct platform_device *op)
        struct xilly_endpoint *endpoint;
        int rc;
        int irq;
-       struct resource *res;
        struct xilly_endpoint_hardware *ephw = &of_hw;
 
        if (of_property_read_bool(dev->of_node, "dma-coherent"))
@@ -129,9 +128,7 @@ static int xilly_drv_probe(struct platform_device *op)
 
        dev_set_drvdata(dev, endpoint);
 
-       res = platform_get_resource(op, IORESOURCE_MEM, 0);
-       endpoint->registers = devm_ioremap_resource(dev, res);
-
+       endpoint->registers = devm_platform_ioremap_resource(op, 0);
        if (IS_ERR(endpoint->registers))
                return PTR_ERR(endpoint->registers);