Skip to content

Commit

Permalink
ASoC: Convert wm8996 to use devm_kzalloc()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Nov 27, 2011
1 parent 897f784 commit a290986
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sound/soc/codecs/wm8996.c
Original file line number Diff line number Diff line change
Expand Up @@ -3104,7 +3104,8 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c,
int ret, i;
unsigned int reg;

wm8996 = kzalloc(sizeof(struct wm8996_priv), GFP_KERNEL);
wm8996 = devm_kzalloc(&i2c->dev, sizeof(struct wm8996_priv),
GFP_KERNEL);
if (wm8996 == NULL)
return -ENOMEM;

Expand Down Expand Up @@ -3216,7 +3217,6 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c,
if (wm8996->pdata.ldo_ena > 0)
gpio_free(wm8996->pdata.ldo_ena);
err:
kfree(wm8996);

return ret;
}
Expand All @@ -3234,7 +3234,6 @@ static __devexit int wm8996_i2c_remove(struct i2c_client *client)
gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0);
gpio_free(wm8996->pdata.ldo_ena);
}
kfree(wm8996);
return 0;
}

Expand Down

0 comments on commit a290986

Please sign in to comment.