public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mfd: 88pm860x: Use devm_regmap_init_i2c()
@ 2013-06-12  8:25 Sachin Kamat
  2013-06-12  9:27 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Sachin Kamat @ 2013-06-12  8:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, sachin.kamat

devm_regmap_init_i2c() is device managed and makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mfd/88pm860x-core.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index ef6d82c..eeb481d 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1156,7 +1156,7 @@ static int pm860x_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	chip->id = verify_addr(client);
-	chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config);
+	chip->regmap = devm_regmap_init_i2c(client, &pm860x_regmap_config);
 	if (IS_ERR(chip->regmap)) {
 		ret = PTR_ERR(chip->regmap);
 		dev_err(&client->dev, "Failed to allocate register map: %d\n",
@@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client)
 		regmap_exit(chip->regmap_companion);
 		i2c_unregister_device(chip->companion);
 	}
-	regmap_exit(chip->regmap);
 	return 0;
 }
 
-- 
1.7.9.5


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

* Re: [PATCH 1/1] mfd: 88pm860x: Use devm_regmap_init_i2c()
  2013-06-12  8:25 [PATCH 1/1] mfd: 88pm860x: Use devm_regmap_init_i2c() Sachin Kamat
@ 2013-06-12  9:27 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2013-06-12  9:27 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, sameo

On Wed, 12 Jun 2013, Sachin Kamat wrote:

> devm_regmap_init_i2c() is device managed and makes cleanup simpler.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/mfd/88pm860x-core.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
> index ef6d82c..eeb481d 100644
> --- a/drivers/mfd/88pm860x-core.c
> +++ b/drivers/mfd/88pm860x-core.c
> @@ -1156,7 +1156,7 @@ static int pm860x_probe(struct i2c_client *client,
>  		return -ENOMEM;
>  
>  	chip->id = verify_addr(client);
> -	chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config);
> +	chip->regmap = devm_regmap_init_i2c(client, &pm860x_regmap_config);
>  	if (IS_ERR(chip->regmap)) {
>  		ret = PTR_ERR(chip->regmap);
>  		dev_err(&client->dev, "Failed to allocate register map: %d\n",
> @@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client)
>  		regmap_exit(chip->regmap_companion);
>  		i2c_unregister_device(chip->companion);
>  	}
> -	regmap_exit(chip->regmap);
>  	return 0;
>  }

Applied, thanks.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2013-06-12  9:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-12  8:25 [PATCH 1/1] mfd: 88pm860x: Use devm_regmap_init_i2c() Sachin Kamat
2013-06-12  9:27 ` Lee Jones

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