mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
ASoC: Convert wm8996 to use devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
897f7847e6
commit
a290986b2a
1 changed files with 2 additions and 3 deletions
|
@ -3104,7 +3104,8 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c,
|
||||||
int ret, i;
|
int ret, i;
|
||||||
unsigned int reg;
|
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)
|
if (wm8996 == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -3216,7 +3217,6 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c,
|
||||||
if (wm8996->pdata.ldo_ena > 0)
|
if (wm8996->pdata.ldo_ena > 0)
|
||||||
gpio_free(wm8996->pdata.ldo_ena);
|
gpio_free(wm8996->pdata.ldo_ena);
|
||||||
err:
|
err:
|
||||||
kfree(wm8996);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3234,7 +3234,6 @@ static __devexit int wm8996_i2c_remove(struct i2c_client *client)
|
||||||
gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0);
|
gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0);
|
||||||
gpio_free(wm8996->pdata.ldo_ena);
|
gpio_free(wm8996->pdata.ldo_ena);
|
||||||
}
|
}
|
||||||
kfree(wm8996);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue