diff options
-rw-r--r-- | drivers/regulator/wm831x-dcdc.c | 10 | ||||
-rw-r--r-- | drivers/regulator/wm831x-isink.c | 5 | ||||
-rw-r--r-- | drivers/regulator/wm831x-ldo.c | 12 |
3 files changed, 9 insertions, 18 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: | |||
590 | err: | 591 | err: |
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) | |||
771 | err_regulator: | 771 | err_regulator: |
772 | regulator_unregister(dcdc->regulator); | 772 | regulator_unregister(dcdc->regulator); |
773 | err: | 773 | err: |
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 | } |
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c index d3ad3f5cff46..634aac3f2d5f 100644 --- a/drivers/regulator/wm831x-isink.c +++ b/drivers/regulator/wm831x-isink.c | |||
@@ -162,7 +162,8 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev) | |||
162 | if (pdata == NULL || pdata->isink[id] == NULL) | 162 | if (pdata == NULL || pdata->isink[id] == NULL) |
163 | return -ENODEV; | 163 | return -ENODEV; |
164 | 164 | ||
165 | isink = kzalloc(sizeof(struct wm831x_isink), GFP_KERNEL); | 165 | isink = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_isink), |
166 | GFP_KERNEL); | ||
166 | if (isink == NULL) { | 167 | if (isink == NULL) { |
167 | dev_err(&pdev->dev, "Unable to allocate private data\n"); | 168 | dev_err(&pdev->dev, "Unable to allocate private data\n"); |
168 | return -ENOMEM; | 169 | return -ENOMEM; |
@@ -213,7 +214,6 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev) | |||
213 | err_regulator: | 214 | err_regulator: |
214 | regulator_unregister(isink->regulator); | 215 | regulator_unregister(isink->regulator); |
215 | err: | 216 | err: |
216 | kfree(isink); | ||
217 | return ret; | 217 | return ret; |
218 | } | 218 | } |
219 | 219 | ||
@@ -226,7 +226,6 @@ static __devexit int wm831x_isink_remove(struct platform_device *pdev) | |||
226 | free_irq(platform_get_irq(pdev, 0), isink); | 226 | free_irq(platform_get_irq(pdev, 0), isink); |
227 | 227 | ||
228 | regulator_unregister(isink->regulator); | 228 | regulator_unregister(isink->regulator); |
229 | kfree(isink); | ||
230 | 229 | ||
231 | return 0; | 230 | return 0; |
232 | } | 231 | } |
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 5e96a2386b1d..f1e4ab0f9fda 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
@@ -326,7 +326,7 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev) | |||
326 | if (pdata == NULL || pdata->ldo[id] == NULL) | 326 | if (pdata == NULL || pdata->ldo[id] == NULL) |
327 | return -ENODEV; | 327 | return -ENODEV; |
328 | 328 | ||
329 | ldo = kzalloc(sizeof(struct wm831x_ldo), GFP_KERNEL); | 329 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); |
330 | if (ldo == NULL) { | 330 | if (ldo == NULL) { |
331 | dev_err(&pdev->dev, "Unable to allocate private data\n"); | 331 | dev_err(&pdev->dev, "Unable to allocate private data\n"); |
332 | return -ENOMEM; | 332 | return -ENOMEM; |
@@ -376,7 +376,6 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev) | |||
376 | err_regulator: | 376 | err_regulator: |
377 | regulator_unregister(ldo->regulator); | 377 | regulator_unregister(ldo->regulator); |
378 | err: | 378 | err: |
379 | kfree(ldo); | ||
380 | return ret; | 379 | return ret; |
381 | } | 380 | } |
382 | 381 | ||
@@ -388,7 +387,6 @@ static __devexit int wm831x_gp_ldo_remove(struct platform_device *pdev) | |||
388 | 387 | ||
389 | free_irq(platform_get_irq_byname(pdev, "UV"), ldo); | 388 | free_irq(platform_get_irq_byname(pdev, "UV"), ldo); |
390 | regulator_unregister(ldo->regulator); | 389 | regulator_unregister(ldo->regulator); |
391 | kfree(ldo); | ||
392 | 390 | ||
393 | return 0; | 391 | return 0; |
394 | } | 392 | } |
@@ -596,7 +594,7 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev) | |||
596 | if (pdata == NULL || pdata->ldo[id] == NULL) | 594 | if (pdata == NULL || pdata->ldo[id] == NULL) |
597 | return -ENODEV; | 595 | return -ENODEV; |
598 | 596 | ||
599 | ldo = kzalloc(sizeof(struct wm831x_ldo), GFP_KERNEL); | 597 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); |
600 | if (ldo == NULL) { | 598 | if (ldo == NULL) { |
601 | dev_err(&pdev->dev, "Unable to allocate private data\n"); | 599 | dev_err(&pdev->dev, "Unable to allocate private data\n"); |
602 | return -ENOMEM; | 600 | return -ENOMEM; |
@@ -645,7 +643,6 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev) | |||
645 | err_regulator: | 643 | err_regulator: |
646 | regulator_unregister(ldo->regulator); | 644 | regulator_unregister(ldo->regulator); |
647 | err: | 645 | err: |
648 | kfree(ldo); | ||
649 | return ret; | 646 | return ret; |
650 | } | 647 | } |
651 | 648 | ||
@@ -655,7 +652,6 @@ static __devexit int wm831x_aldo_remove(struct platform_device *pdev) | |||
655 | 652 | ||
656 | free_irq(platform_get_irq_byname(pdev, "UV"), ldo); | 653 | free_irq(platform_get_irq_byname(pdev, "UV"), ldo); |
657 | regulator_unregister(ldo->regulator); | 654 | regulator_unregister(ldo->regulator); |
658 | kfree(ldo); | ||
659 | 655 | ||
660 | return 0; | 656 | return 0; |
661 | } | 657 | } |
@@ -793,7 +789,7 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev) | |||
793 | if (pdata == NULL || pdata->ldo[id] == NULL) | 789 | if (pdata == NULL || pdata->ldo[id] == NULL) |
794 | return -ENODEV; | 790 | return -ENODEV; |
795 | 791 | ||
796 | ldo = kzalloc(sizeof(struct wm831x_ldo), GFP_KERNEL); | 792 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); |
797 | if (ldo == NULL) { | 793 | if (ldo == NULL) { |
798 | dev_err(&pdev->dev, "Unable to allocate private data\n"); | 794 | dev_err(&pdev->dev, "Unable to allocate private data\n"); |
799 | return -ENOMEM; | 795 | return -ENOMEM; |
@@ -831,7 +827,6 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev) | |||
831 | return 0; | 827 | return 0; |
832 | 828 | ||
833 | err: | 829 | err: |
834 | kfree(ldo); | ||
835 | return ret; | 830 | return ret; |
836 | } | 831 | } |
837 | 832 | ||
@@ -840,7 +835,6 @@ static __devexit int wm831x_alive_ldo_remove(struct platform_device *pdev) | |||
840 | struct wm831x_ldo *ldo = platform_get_drvdata(pdev); | 835 | struct wm831x_ldo *ldo = platform_get_drvdata(pdev); |
841 | 836 | ||
842 | regulator_unregister(ldo->regulator); | 837 | regulator_unregister(ldo->regulator); |
843 | kfree(ldo); | ||
844 | 838 | ||
845 | return 0; | 839 | return 0; |
846 | } | 840 | } |