Commit 7d2600b9 authored by YueHaibing's avatar YueHaibing Committed by Mark Brown

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904135918.25352-15-yuehaibing@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d8e477ab
...@@ -185,7 +185,6 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) ...@@ -185,7 +185,6 @@ spi_lp8841_rtc_probe(struct platform_device *pdev)
int ret; int ret;
struct spi_master *master; struct spi_master *master;
struct spi_lp8841_rtc *data; struct spi_lp8841_rtc *data;
void *iomem;
master = spi_alloc_master(&pdev->dev, sizeof(*data)); master = spi_alloc_master(&pdev->dev, sizeof(*data));
if (!master) if (!master)
...@@ -207,8 +206,7 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) ...@@ -207,8 +206,7 @@ spi_lp8841_rtc_probe(struct platform_device *pdev)
data = spi_master_get_devdata(master); data = spi_master_get_devdata(master);
iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); data->iomem = devm_platform_ioremap_resource(pdev, 0);
data->iomem = devm_ioremap_resource(&pdev->dev, iomem);
ret = PTR_ERR_OR_ZERO(data->iomem); ret = PTR_ERR_OR_ZERO(data->iomem);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to get IO address\n"); dev_err(&pdev->dev, "failed to get IO address\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment