public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: sameo@linux.intel.com
Cc: linux-kernel@vger.kernel.org,
	broonie@opensource.wolfsonmicro.com,
	u.kleine-koenig@pengutronix.de,
	Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH 2/2] mfd: mc13xxx-spi: Convert to devm_regmap_init_spi()
Date: Sat,  9 Jun 2012 02:35:31 -0300	[thread overview]
Message-ID: <1339220131-24189-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1339220131-24189-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

Current code misses a "regmap_exit(mc13xxx->regmap)" in the error and remove paths.

Converting to devm_regmap_init_i2c() makes the regmap_exit unnecessary.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mfd/mc13xxx-spi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
index 3fcdab3..62e537b 100644
--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -78,7 +78,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
 	mc13xxx->dev = &spi->dev;
 	mutex_init(&mc13xxx->lock);
 
-	mc13xxx->regmap = regmap_init_spi(spi, &mc13xxx_regmap_spi_config);
+	mc13xxx->regmap = devm_regmap_init_spi(spi, &mc13xxx_regmap_spi_config);
 	if (IS_ERR(mc13xxx->regmap)) {
 		ret = PTR_ERR(mc13xxx->regmap);
 		dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n",
-- 
1.7.1


  reply	other threads:[~2012-06-09  5:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-09  5:35 [PATCH 1/2] mfd: mc13xxx-i2c: Convert to devm_regmap_init_i2c() Fabio Estevam
2012-06-09  5:35 ` Fabio Estevam [this message]
2012-06-10 14:38 ` Axel Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339220131-24189-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox