summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-cadence.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-09-04 15:58:50 +0200
committerMark Brown <broonie@kernel.org>2019-09-04 18:17:07 +0200
commit4585bb92a57605984faa49c8f9f36b8a9b14bb12 (patch)
tree2090dbf7d6cc5ff0c9bbe7a0351da5f0dc1f4a03 /drivers/spi/spi-cadence.c
parentspi: bcm63xx-hsspi: use devm_platform_ioremap_resource() to simplify code (diff)
downloadlinux-4585bb92a57605984faa49c8f9f36b8a9b14bb12.tar.xz
linux-4585bb92a57605984faa49c8f9f36b8a9b14bb12.zip
spi: cadence: 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-9-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-cadence.c')
-rw-r--r--drivers/spi/spi-cadence.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 1c35eaaac838..c36587b42e95 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -474,7 +474,6 @@ static int cdns_spi_probe(struct platform_device *pdev)
int ret = 0, irq;
struct spi_master *master;
struct cdns_spi *xspi;
- struct resource *res;
u32 num_cs;
master = spi_alloc_master(&pdev->dev, sizeof(*xspi));
@@ -485,8 +484,7 @@ static int cdns_spi_probe(struct platform_device *pdev)
master->dev.of_node = pdev->dev.of_node;
platform_set_drvdata(pdev, master);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- xspi->regs = devm_ioremap_resource(&pdev->dev, res);
+ xspi->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(xspi->regs)) {
ret = PTR_ERR(xspi->regs);
goto remove_master;