Re: [PATCH 1/2] mfd: mc13xxx-i2c: Convert to devm_regmap_init_i2c()

From: Axel Lin
Date: Sun Jun 10 2012 - 10:38:42 EST


2012/6/9 Fabio Estevam <festevam@xxxxxxxxx>:
> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
>
> 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.

This is already included in this patch: (although it is not yet upstream)
http://www.spinics.net/lists/kernel/msg1346844.html

>
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> ---
>  drivers/mfd/mc13xxx-i2c.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c
> index d22501d..0e38672 100644
> --- a/drivers/mfd/mc13xxx-i2c.c
> +++ b/drivers/mfd/mc13xxx-i2c.c
> @@ -72,7 +72,7 @@ static int mc13xxx_i2c_probe(struct i2c_client *client,
>        mc13xxx->dev = &client->dev;
>        mutex_init(&mc13xxx->lock);
>
> -       mc13xxx->regmap = regmap_init_i2c(client, &mc13xxx_regmap_i2c_config);
> +       mc13xxx->regmap = devm_regmap_init_i2c(client, &mc13xxx_regmap_i2c_config);
To convert to devm_regmap_init_i2c(), you also need to remove the
regmap_exit() call
in mc13xxx_common_cleanup().

Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/