diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-09-04 21:58:56 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-09-04 17:18:35 +0100 |
commit | 7d2600b9cc1346978f81756078e3c815775be22e (patch) | |
tree | 5ec93a2b652fc70655696e20dcf8aa3217ab40c7 | |
parent | d8e477abec244c0ff9b4c4979253f8c349bf1fdd (diff) | |
download | linux-stable-7d2600b9cc1346978f81756078e3c815775be22e.tar.gz linux-stable-7d2600b9cc1346978f81756078e3c815775be22e.tar.bz2 linux-stable-7d2600b9cc1346978f81756078e3c815775be22e.zip |
spi: lp-8841: 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-15-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-lp8841-rtc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-lp8841-rtc.c b/drivers/spi/spi-lp8841-rtc.c index f50779fd329c..2d436541d6c2 100644 --- a/drivers/spi/spi-lp8841-rtc.c +++ b/drivers/spi/spi-lp8841-rtc.c @@ -185,7 +185,6 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) int ret; struct spi_master *master; struct spi_lp8841_rtc *data; - void *iomem; master = spi_alloc_master(&pdev->dev, sizeof(*data)); if (!master) @@ -207,8 +206,7 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) data = spi_master_get_devdata(master); - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - data->iomem = devm_ioremap_resource(&pdev->dev, iomem); + data->iomem = devm_platform_ioremap_resource(pdev, 0); ret = PTR_ERR_OR_ZERO(data->iomem); if (ret) { dev_err(&pdev->dev, "failed to get IO address\n"); |