Commit d4225b36 authored by YueHaibing's avatar YueHaibing Committed by Mark Brown

spi: mxs: 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-19-yuehaibing@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f88771ca
...@@ -532,7 +532,6 @@ static int mxs_spi_probe(struct platform_device *pdev) ...@@ -532,7 +532,6 @@ static int mxs_spi_probe(struct platform_device *pdev)
struct spi_master *master; struct spi_master *master;
struct mxs_spi *spi; struct mxs_spi *spi;
struct mxs_ssp *ssp; struct mxs_ssp *ssp;
struct resource *iores;
struct clk *clk; struct clk *clk;
void __iomem *base; void __iomem *base;
int devid, clk_freq; int devid, clk_freq;
...@@ -545,12 +544,11 @@ static int mxs_spi_probe(struct platform_device *pdev) ...@@ -545,12 +544,11 @@ static int mxs_spi_probe(struct platform_device *pdev)
*/ */
const int clk_freq_default = 160000000; const int clk_freq_default = 160000000;
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq_err = platform_get_irq(pdev, 0); irq_err = platform_get_irq(pdev, 0);
if (irq_err < 0) if (irq_err < 0)
return irq_err; return irq_err;
base = devm_ioremap_resource(&pdev->dev, iores); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
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