ASoC: max98090: Convert to devm_regmap_init_i2c
PATCH 1/1 ASoC: max98090: Convert to devm_regmap_init_i2c
Signed-off-by Axel Lin <[email protected]>
--- sound/soc/codecs/max98090.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
sound/soc/codecs/max98090.c +4 -12
@@ -2324,28 +2324,20 @@ static int max98090_i2c_probe(struct i2c_client *i2c, max98090->pdata = i2c->dev.platform_data; max98090->irq = i2c->irq; - max98090->regmap =regmap_init_i2c (i2c, &max98090_regmap); + max98090->regmap =devm_regmap_init_i2c (i2c, &max98090_regmap);if (IS_ERR (max98090->regmap)) { ret =PTR_ERR (max98090->regmap);dev_err (&i2c->dev,"Failed to allocate regmap: %d\n" , ret); - goto err_enable; +return ret; } - ret =snd_soc_register_codec (&i2c->dev, - &soc_codec_dev_max98090, max98090_dai, -ARRAY_SIZE (max98090_dai)); -if (ret <0 ) -regmap_exit (max98090->regmap); - -err_enable: -return ret; +return snd_soc_register_codec (&i2c->dev, &soc_codec_dev_max98090, + max98090_dai,ARRAY_SIZE (max98090_dai)); }static int max98090_i2c_remove (struct i2c_client *client) { -struct max98090_priv *max98090 =dev_get_drvdata (&client->dev);snd_soc_unregister_codec (&client->dev); -regmap_exit (max98090->regmap);return 0 ; }
Signature · 1 line
1.7.9.5
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Looks like this needs a refresh against current topic/max98090?
2013/3/3 Mark Brown <[email protected]>:
Quoted 4 lines · Axel Lin
Quoted 1 line
Signed-off-by Axel Lin <[email protected]>Looks like this needs a refresh against current topic/max98090?
Oh. Just found there is already a similar patch in topic/max98090 branch. Please ignore this patch.
Thanks,
Axel