diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-09-04 16:58:54 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-09-04 19:18:05 +0300 |
commit | 5cc6fdccbb4a9357ec8b6ef52c44bdffd83c7c6f (patch) | |
tree | 62250140b5b4192baf2a5591ed9419e0f1bac031 /drivers/spi | |
parent | 1e2d65d06d4160d9b0db317302d7020449440da5 (diff) | |
download | linux-5cc6fdccbb4a9357ec8b6ef52c44bdffd83c7c6f.tar.xz |
spi: dw-mmio: 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-13-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-dw-mmio.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index edb3cf6be201..bd46fca3f094 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -79,14 +79,12 @@ static int dw_spi_mscc_init(struct platform_device *pdev, const char *cpu_syscon, u32 if_si_owner_offset) { struct dw_spi_mscc *dwsmscc; - struct resource *res; dwsmscc = devm_kzalloc(&pdev->dev, sizeof(*dwsmscc), GFP_KERNEL); if (!dwsmscc) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - dwsmscc->spi_mst = devm_ioremap_resource(&pdev->dev, res); + dwsmscc->spi_mst = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(dwsmscc->spi_mst)) { dev_err(&pdev->dev, "SPI_MST region map failed\n"); return PTR_ERR(dwsmscc->spi_mst); |