mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: spi: convert to devm_ioremap_resource()
@ 2013-05-13 14:04 Silviu-Mihai Popescu
  2013-05-13 14:16 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Silviu-Mihai Popescu @ 2013-05-13 14:04 UTC (permalink / raw)
  To: spi-devel-general
  Cc: Stephen Warren, Mark Brown, Grant Likely, linux-rpi-kernel,
	linux-kernel, Silviu-Mihai Popescu

Convert  use of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

This was found with coccinelle.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
 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.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: spi: convert to devm_ioremap_resource()
  2013-05-13 14:04 [PATCH] drivers: spi: convert to devm_ioremap_resource() Silviu-Mihai Popescu
@ 2013-05-13 14:16 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-05-13 14:16 UTC (permalink / raw)
  To: Silviu-Mihai Popescu
  Cc: spi-devel-general, Stephen Warren, Grant Likely,
	linux-rpi-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

On Mon, May 13, 2013 at 05:04:46PM +0300, Silviu-Mihai Popescu wrote:
> Convert  use of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.

A version of this patch has already been applied.  Please make sure to
generate patches against the relevant development tree (or -next) to
catch such things.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-13 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 14:04 [PATCH] drivers: spi: convert to devm_ioremap_resource() Silviu-Mihai Popescu
2013-05-13 14:16 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®