diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-09-04 15:58:51 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-09-04 18:17:27 +0200 |
commit | 050688dc72d0d60fb6648895a33483d9cbf6fc63 (patch) | |
tree | 5730b3ad18248bee382a1b1ef4e2579e50e271a0 /drivers/spi/spi-cavium-octeon.c | |
parent | spi: cadence: use devm_platform_ioremap_resource() to simplify code (diff) | |
download | linux-050688dc72d0d60fb6648895a33483d9cbf6fc63.tar.xz linux-050688dc72d0d60fb6648895a33483d9cbf6fc63.zip |
spi: octeon: use devm_platform_ioremap_resource() to simplify code
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-10-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-cavium-octeon.c')
-rw-r--r-- | drivers/spi/spi-cavium-octeon.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-cavium-octeon.c b/drivers/spi/spi-cavium-octeon.c index ee4703e84622..1a2de6ce9064 100644 --- a/drivers/spi/spi-cavium-octeon.c +++ b/drivers/spi/spi-cavium-octeon.c @@ -18,7 +18,6 @@ static int octeon_spi_probe(struct platform_device *pdev) { - struct resource *res_mem; void __iomem *reg_base; struct spi_master *master; struct octeon_spi *p; @@ -30,8 +29,7 @@ static int octeon_spi_probe(struct platform_device *pdev) p = spi_master_get_devdata(master); platform_set_drvdata(pdev, master); - res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - reg_base = devm_ioremap_resource(&pdev->dev, res_mem); + reg_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(reg_base)) { err = PTR_ERR(reg_base); goto fail; |