linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Input: apbps2 - Convert to devm_ioremap_resource()
@ 2013-04-08  9:03 Sachin Kamat
  2013-04-15 20:40 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Sachin Kamat @ 2013-04-08  9:03 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, sachin.kamat, Daniel Hellstrom

Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() 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.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
---
 drivers/input/serio/apbps2.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c
index 2c14e6f..17e01a8 100644
--- a/drivers/input/serio/apbps2.c
+++ b/drivers/input/serio/apbps2.c
@@ -147,11 +147,9 @@ static int apbps2_of_probe(struct platform_device *ofdev)
 
 	/* Find Device Address */
 	res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-	priv->regs = devm_request_and_ioremap(&ofdev->dev, res);
-	if (!priv->regs) {
-		dev_err(&ofdev->dev, "io-regs mapping failed\n");
-		return -EBUSY;
-	}
+	priv->regs = devm_ioremap_resource(&ofdev->dev, res);
+	if (IS_ERR(priv->regs))
+		return PTR_ERR(priv->regs);
 
 	/* Reset hardware, disable interrupt */
 	iowrite32be(0, &priv->regs->ctrl);
-- 
1.7.9.5


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

* Re: [PATCH 1/1] Input: apbps2 - Convert to devm_ioremap_resource()
  2013-04-08  9:03 [PATCH 1/1] Input: apbps2 - Convert to devm_ioremap_resource() Sachin Kamat
@ 2013-04-15 20:40 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2013-04-15 20:40 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-input, Daniel Hellstrom

On Mon, Apr 08, 2013 at 02:33:51PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() 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.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Daniel Hellstrom <daniel@gaisler.com>

Applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2013-04-15 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-08  9:03 [PATCH 1/1] Input: apbps2 - Convert to devm_ioremap_resource() Sachin Kamat
2013-04-15 20:40 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).