Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329969
b: refs/heads/master
c: 39c1421
h: refs/heads/master
i:
  329967: 11693b8
v: v3
  • Loading branch information
Peter Ujfalusi authored and Samuel Ortiz committed Sep 18, 2012
1 parent 721b460 commit 42a3019
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41569a16e4e12910e14ce98edea9ef30bd89299b
refs/heads/master: 39c1421db694ee2594bbb2196b1b5a3085e3c656
15 changes: 6 additions & 9 deletions trunk/drivers/mfd/twl4030-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev)
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
val, TWL4030_REG_APLL_CTL);

audio = kzalloc(sizeof(struct twl4030_audio), GFP_KERNEL);
audio = devm_kzalloc(&pdev->dev, sizeof(struct twl4030_audio),
GFP_KERNEL);
if (!audio)
return -ENOMEM;

Expand Down Expand Up @@ -229,22 +230,18 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev)
ret = -ENODEV;
}

if (!ret)
return 0;
if (ret) {
platform_set_drvdata(pdev, NULL);
twl4030_audio_dev = NULL;
}

platform_set_drvdata(pdev, NULL);
kfree(audio);
twl4030_audio_dev = NULL;
return ret;
}

static int __devexit twl4030_audio_remove(struct platform_device *pdev)
{
struct twl4030_audio *audio = platform_get_drvdata(pdev);

mfd_remove_devices(&pdev->dev);
platform_set_drvdata(pdev, NULL);
kfree(audio);
twl4030_audio_dev = NULL;

return 0;
Expand Down

0 comments on commit 42a3019

Please sign in to comment.