aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-dcdc.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-14 13:11:14 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-20 06:29:05 -0500
commitfded2f4faee7670b0545ac05bd2b3ed6b9afcda2 (patch)
treed9902d70c0e93366330e1b0aae7b88263e1fe4f6 /drivers/regulator/wm831x-dcdc.c
parent6242eae9bce864467bc4d6a8b67d1846ecaccf23 (diff)
regulator: Convert wm831x regulator drivers to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r--drivers/regulator/wm831x-dcdc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 7558a9666a50..4904a40b0d46 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -511,7 +511,8 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
511 if (pdata == NULL || pdata->dcdc[id] == NULL) 511 if (pdata == NULL || pdata->dcdc[id] == NULL)
512 return -ENODEV; 512 return -ENODEV;
513 513
514 dcdc = kzalloc(sizeof(struct wm831x_dcdc), GFP_KERNEL); 514 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc),
515 GFP_KERNEL);
515 if (dcdc == NULL) { 516 if (dcdc == NULL) {
516 dev_err(&pdev->dev, "Unable to allocate private data\n"); 517 dev_err(&pdev->dev, "Unable to allocate private data\n");
517 return -ENOMEM; 518 return -ENOMEM;
@@ -590,7 +591,6 @@ err_regulator:
590err: 591err:
591 if (dcdc->dvs_gpio) 592 if (dcdc->dvs_gpio)
592 gpio_free(dcdc->dvs_gpio); 593 gpio_free(dcdc->dvs_gpio);
593 kfree(dcdc);
594 return ret; 594 return ret;
595} 595}
596 596
@@ -605,7 +605,6 @@ static __devexit int wm831x_buckv_remove(struct platform_device *pdev)
605 regulator_unregister(dcdc->regulator); 605 regulator_unregister(dcdc->regulator);
606 if (dcdc->dvs_gpio) 606 if (dcdc->dvs_gpio)
607 gpio_free(dcdc->dvs_gpio); 607 gpio_free(dcdc->dvs_gpio);
608 kfree(dcdc);
609 608
610 return 0; 609 return 0;
611} 610}
@@ -722,7 +721,8 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev)
722 if (pdata == NULL || pdata->dcdc[id] == NULL) 721 if (pdata == NULL || pdata->dcdc[id] == NULL)
723 return -ENODEV; 722 return -ENODEV;
724 723
725 dcdc = kzalloc(sizeof(struct wm831x_dcdc), GFP_KERNEL); 724 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc),
725 GFP_KERNEL);
726 if (dcdc == NULL) { 726 if (dcdc == NULL) {
727 dev_err(&pdev->dev, "Unable to allocate private data\n"); 727 dev_err(&pdev->dev, "Unable to allocate private data\n");
728 return -ENOMEM; 728 return -ENOMEM;
@@ -771,7 +771,6 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev)
771err_regulator: 771err_regulator:
772 regulator_unregister(dcdc->regulator); 772 regulator_unregister(dcdc->regulator);
773err: 773err:
774 kfree(dcdc);
775 return ret; 774 return ret;
776} 775}
777 776
@@ -783,7 +782,6 @@ static __devexit int wm831x_buckp_remove(struct platform_device *pdev)
783 782
784 free_irq(platform_get_irq_byname(pdev, "UV"), dcdc); 783 free_irq(platform_get_irq_byname(pdev, "UV"), dcdc);
785 regulator_unregister(dcdc->regulator); 784 regulator_unregister(dcdc->regulator);
786 kfree(dcdc);
787 785
788 return 0; 786 return 0;
789} 787}