X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sound%2Fsoc%2Fcodecs%2Fwm5100.c;h=844d5d287976b4ac6edd8864a5ef1d275e3e7ee3;hb=a81b82c09e70db853cb270ed9ac166b6c50d7b8c;hp=f37d67f4058b5254c0950e150212c895c4abf93b;hpb=d9b5e9c6bccc3850b91ddaac11b49f2510375f5b;p=deliverable%2Flinux.git diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index f37d67f4058b..844d5d287976 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c @@ -1661,7 +1661,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream, return 0; } -static struct snd_soc_dai_ops wm5100_dai_ops = { +static const struct snd_soc_dai_ops wm5100_dai_ops = { .set_fmt = wm5100_set_fmt, .hw_params = wm5100_hw_params, }; @@ -2607,7 +2607,8 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, unsigned int reg; int ret, i; - wm5100 = kzalloc(sizeof(struct wm5100_priv), GFP_KERNEL); + wm5100 = devm_kzalloc(&i2c->dev, sizeof(struct wm5100_priv), + GFP_KERNEL); if (wm5100 == NULL) return -ENOMEM; @@ -2616,7 +2617,7 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, ret = PTR_ERR(wm5100->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", ret); - goto err_alloc; + goto err; } for (i = 0; i < ARRAY_SIZE(wm5100->fll); i++) @@ -2774,8 +2775,7 @@ err_core: wm5100->core_supplies); err_regmap: regmap_exit(wm5100->regmap); -err_alloc: - kfree(wm5100); +err: return ret; } @@ -2799,7 +2799,6 @@ static __devexit int wm5100_i2c_remove(struct i2c_client *client) regulator_bulk_free(ARRAY_SIZE(wm5100->core_supplies), wm5100->core_supplies); regmap_exit(wm5100->regmap); - kfree(wm5100); return 0; }