mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 00:30:52 +07:00
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>
This commit is contained in:
parent
d8e477abec
commit
7d2600b9cc
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user