spi: bcm2835aux: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 4 Sep 2019 13:58:47 +0000 (21:58 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 4 Sep 2019 16:16:08 +0000 (17:16 +0100)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904135918.25352-6-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm2835aux.c

index b18ce69c037560065ab5e6d41b7485e5587f27a3..a2162ff56a121f1a5072d9c87251c8986cb80521 100644 (file)
@@ -491,7 +491,6 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
 {
        struct spi_master *master;
        struct bcm2835aux_spi *bs;
-       struct resource *res;
        unsigned long clk_hz;
        int err;
 
@@ -524,8 +523,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
        bs = spi_master_get_devdata(master);
 
        /* the main area */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       bs->regs = devm_ioremap_resource(&pdev->dev, res);
+       bs->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(bs->regs)) {
                err = PTR_ERR(bs->regs);
                goto out_master_put;