Commit 6ab7e71a authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert 88pm860x-codec to devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6ce91ad4
...@@ -1430,7 +1430,8 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev) ...@@ -1430,7 +1430,8 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int i, ret; int i, ret;
pm860x = kzalloc(sizeof(struct pm860x_priv), GFP_KERNEL); pm860x = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_priv),
GFP_KERNEL);
if (pm860x == NULL) if (pm860x == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -1459,17 +1460,13 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev) ...@@ -1459,17 +1460,13 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev)
out: out:
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(pm860x);
return -EINVAL; return -EINVAL;
} }
static int __devexit pm860x_codec_remove(struct platform_device *pdev) static int __devexit pm860x_codec_remove(struct platform_device *pdev)
{ {
struct pm860x_priv *pm860x = platform_get_drvdata(pdev);
snd_soc_unregister_codec(&pdev->dev); snd_soc_unregister_codec(&pdev->dev);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(pm860x);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment