Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344713
b: refs/heads/master
c: 0b672e9
h: refs/heads/master
i:
  344711: 1a69f29
v: v3
  • Loading branch information
Sachin Kamat authored and MyungJoo Ham committed Nov 21, 2012
1 parent 1c752f7 commit 7a7184f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 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: 2ca36f4afd0b0c3b9f99e1c03bbfafeb39516cf6
refs/heads/master: 0b672e9b21942fdfa63519fb66df4a40d6fafe35
18 changes: 6 additions & 12 deletions trunk/drivers/extcon/extcon-max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
struct max8997_muic_info *info;
int ret, i;

info = kzalloc(sizeof(struct max8997_muic_info), GFP_KERNEL);
info = devm_kzalloc(&pdev->dev, sizeof(struct max8997_muic_info),
GFP_KERNEL);
if (!info) {
dev_err(&pdev->dev, "failed to allocate memory\n");
ret = -ENOMEM;
goto err_kfree;
return -ENOMEM;
}

info->dev = &pdev->dev;
Expand Down Expand Up @@ -471,7 +471,8 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
}

/* External connector */
info->edev = kzalloc(sizeof(struct extcon_dev), GFP_KERNEL);
info->edev = devm_kzalloc(&pdev->dev, sizeof(struct extcon_dev),
GFP_KERNEL);
if (!info->edev) {
dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
ret = -ENOMEM;
Expand All @@ -482,7 +483,7 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
ret = extcon_dev_register(info->edev, NULL);
if (ret) {
dev_err(&pdev->dev, "failed to register extcon device\n");
goto err_extcon;
goto err_irq;
}

/* Initialize registers according to platform data */
Expand All @@ -500,13 +501,9 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)

return ret;

err_extcon:
kfree(info->edev);
err_irq:
while (--i >= 0)
free_irq(muic_irqs[i].virq, info);
kfree(info);
err_kfree:
return ret;
}

Expand All @@ -521,9 +518,6 @@ static int __devexit max8997_muic_remove(struct platform_device *pdev)

extcon_dev_unregister(info->edev);

kfree(info->edev);
kfree(info);

return 0;
}

Expand Down

0 comments on commit 7a7184f

Please sign in to comment.