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

spi: bcm2835aux: 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-6-yuehaibing@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7d6a5e2b
...@@ -491,7 +491,6 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev) ...@@ -491,7 +491,6 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
{ {
struct spi_master *master; struct spi_master *master;
struct bcm2835aux_spi *bs; struct bcm2835aux_spi *bs;
struct resource *res;
unsigned long clk_hz; unsigned long clk_hz;
int err; int err;
...@@ -524,8 +523,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev) ...@@ -524,8 +523,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
bs = spi_master_get_devdata(master); bs = spi_master_get_devdata(master);
/* the main area */ /* the main area */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); bs->regs = devm_platform_ioremap_resource(pdev, 0);
bs->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(bs->regs)) { if (IS_ERR(bs->regs)) {
err = PTR_ERR(bs->regs); err = PTR_ERR(bs->regs);
goto out_master_put; goto out_master_put;
......
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