aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-24 13:28:51 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-25 08:03:25 -0500
commita81b82c09e70db853cb270ed9ac166b6c50d7b8c (patch)
treeeeedb2b8f7ea648a5418ed7a952860b6f19caa19 /sound
parent878042d19c760178ba08ed24025d08ba750e38c3 (diff)
ASoC: Use devm_kzalloc() in wm5100
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm5100.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index 6c79d97ba181..844d5d287976 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -2607,7 +2607,8 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c,
2607 unsigned int reg; 2607 unsigned int reg;
2608 int ret, i; 2608 int ret, i;
2609 2609
2610 wm5100 = kzalloc(sizeof(struct wm5100_priv), GFP_KERNEL); 2610 wm5100 = devm_kzalloc(&i2c->dev, sizeof(struct wm5100_priv),
2611 GFP_KERNEL);
2611 if (wm5100 == NULL) 2612 if (wm5100 == NULL)
2612 return -ENOMEM; 2613 return -ENOMEM;
2613 2614
@@ -2616,7 +2617,7 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c,
2616 ret = PTR_ERR(wm5100->regmap); 2617 ret = PTR_ERR(wm5100->regmap);
2617 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", 2618 dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
2618 ret); 2619 ret);
2619 goto err_alloc; 2620 goto err;
2620 } 2621 }
2621 2622
2622 for (i = 0; i < ARRAY_SIZE(wm5100->fll); i++) 2623 for (i = 0; i < ARRAY_SIZE(wm5100->fll); i++)
@@ -2774,8 +2775,7 @@ err_core:
2774 wm5100->core_supplies); 2775 wm5100->core_supplies);
2775err_regmap: 2776err_regmap:
2776 regmap_exit(wm5100->regmap); 2777 regmap_exit(wm5100->regmap);
2777err_alloc: 2778err:
2778 kfree(wm5100);
2779 return ret; 2779 return ret;
2780} 2780}
2781 2781
@@ -2799,7 +2799,6 @@ static __devexit int wm5100_i2c_remove(struct i2c_client *client)
2799 regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies), 2799 regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies),
2800 wm5100->core_supplies); 2800 wm5100->core_supplies);
2801 regmap_exit(wm5100->regmap); 2801 regmap_exit(wm5100->regmap);
2802 kfree(wm5100);
2803 2802
2804 return 0; 2803 return 0;
2805} 2804}