aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/88pm860x-codec.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 99ca53c01676..9fd3b6827bba 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -1430,7 +1430,8 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev)
1430 struct resource *res; 1430 struct resource *res;
1431 int i, ret; 1431 int i, ret;
1432 1432
1433 pm860x = kzalloc(sizeof(struct pm860x_priv), GFP_KERNEL); 1433 pm860x = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_priv),
1434 GFP_KERNEL);
1434 if (pm860x == NULL) 1435 if (pm860x == NULL)
1435 return -ENOMEM; 1436 return -ENOMEM;
1436 1437
@@ -1459,17 +1460,13 @@ static int __devinit pm860x_codec_probe(struct platform_device *pdev)
1459 1460
1460out: 1461out:
1461 platform_set_drvdata(pdev, NULL); 1462 platform_set_drvdata(pdev, NULL);
1462 kfree(pm860x);
1463 return -EINVAL; 1463 return -EINVAL;
1464} 1464}
1465 1465
1466static int __devexit pm860x_codec_remove(struct platform_device *pdev) 1466static int __devexit pm860x_codec_remove(struct platform_device *pdev)
1467{ 1467{
1468 struct pm860x_priv *pm860x = platform_get_drvdata(pdev);
1469
1470 snd_soc_unregister_codec(&pdev->dev); 1468 snd_soc_unregister_codec(&pdev->dev);
1471 platform_set_drvdata(pdev, NULL); 1469 platform_set_drvdata(pdev, NULL);
1472 kfree(pm860x);
1473 return 0; 1470 return 0;
1474} 1471}
1475 1472