2013-05-02 12:05:40

by Laurent Navet

[permalink] [raw]
Subject: [PATCH] drivers: spi: bmc2835: use devm_ioremap_resource()

Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet <[email protected]>
---
drivers/spi/spi-bcm2835.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 89c0b50..a4185e4 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -331,10 +331,9 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
goto out_master_put;
}

- bs->regs = devm_request_and_ioremap(&pdev->dev, res);
- if (!bs->regs) {
- dev_err(&pdev->dev, "could not request/map memory region\n");
- err = -ENODEV;
+ bs->regs = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(bs->regs)) {
+ err = PTR_ERR(bs->regs);
goto out_master_put;
}

--
1.7.10.4


2013-05-03 09:42:23

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] drivers: spi: bmc2835: use devm_ioremap_resource()

On Thu, May 02, 2013 at 02:13:30PM +0200, Laurent Navet wrote:
> Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Applied, thanks. Please use subject lines that match those normally
used by the subsystem.


Attachments:
(No filename) (238.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments