提交 a290986b 编写于 作者: M Mark Brown

ASoC: Convert wm8996 to use devm_kzalloc()

Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 897f7847
......@@ -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;
......@@ -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;
}
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册