spi: spi-axi: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 4 Sep 2019 13:58:46 +0000 (21:58 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 4 Sep 2019 16:15:49 +0000 (17:15 +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-5-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-axi-spi-engine.c

index 3b1833e6c7ad0d54e89516349bd8d47eee3843fb..74842f6019ed13a5640a7e451cca79584f8cb3bf 100644 (file)
@@ -460,7 +460,6 @@ static int spi_engine_probe(struct platform_device *pdev)
        struct spi_engine *spi_engine;
        struct spi_master *master;
        unsigned int version;
-       struct resource *res;
        int irq;
        int ret;
 
@@ -480,8 +479,7 @@ static int spi_engine_probe(struct platform_device *pdev)
 
        spin_lock_init(&spi_engine->lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       spi_engine->base = devm_ioremap_resource(&pdev->dev, res);
+       spi_engine->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(spi_engine->base)) {
                ret = PTR_ERR(spi_engine->base);
                goto err_put_master;