aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-dcdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r--drivers/regulator/wm831x-dcdc.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index a885911bb5fc..099da11e989f 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -535,7 +535,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
535 goto err; 535 goto err;
536 } 536 }
537 537
538 irq = platform_get_irq_byname(pdev, "UV"); 538 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
539 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_uv_irq, 539 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_uv_irq,
540 IRQF_TRIGGER_RISING, dcdc->name, dcdc); 540 IRQF_TRIGGER_RISING, dcdc->name, dcdc);
541 if (ret != 0) { 541 if (ret != 0) {
@@ -544,7 +544,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
544 goto err_regulator; 544 goto err_regulator;
545 } 545 }
546 546
547 irq = platform_get_irq_byname(pdev, "HC"); 547 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "HC"));
548 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_oc_irq, 548 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_oc_irq,
549 IRQF_TRIGGER_RISING, dcdc->name, dcdc); 549 IRQF_TRIGGER_RISING, dcdc->name, dcdc);
550 if (ret != 0) { 550 if (ret != 0) {
@@ -558,7 +558,8 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
558 return 0; 558 return 0;
559 559
560err_uv: 560err_uv:
561 free_irq(platform_get_irq_byname(pdev, "UV"), dcdc); 561 free_irq(wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV")),
562 dcdc);
562err_regulator: 563err_regulator:
563 regulator_unregister(dcdc->regulator); 564 regulator_unregister(dcdc->regulator);
564err: 565err:
@@ -570,11 +571,14 @@ err:
570static __devexit int wm831x_buckv_remove(struct platform_device *pdev) 571static __devexit int wm831x_buckv_remove(struct platform_device *pdev)
571{ 572{
572 struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); 573 struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev);
574 struct wm831x *wm831x = dcdc->wm831x;
573 575
574 platform_set_drvdata(pdev, NULL); 576 platform_set_drvdata(pdev, NULL);
575 577
576 free_irq(platform_get_irq_byname(pdev, "HC"), dcdc); 578 free_irq(wm831x_irq(wm831x, platform_get_irq_byname(pdev, "HC")),
577 free_irq(platform_get_irq_byname(pdev, "UV"), dcdc); 579 dcdc);
580 free_irq(wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV")),
581 dcdc);
578 regulator_unregister(dcdc->regulator); 582 regulator_unregister(dcdc->regulator);
579 if (dcdc->dvs_gpio) 583 if (dcdc->dvs_gpio)
580 gpio_free(dcdc->dvs_gpio); 584 gpio_free(dcdc->dvs_gpio);
@@ -726,7 +730,7 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev)
726 goto err; 730 goto err;
727 } 731 }
728 732
729 irq = platform_get_irq_byname(pdev, "UV"); 733 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
730 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_uv_irq, 734 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_uv_irq,
731 IRQF_TRIGGER_RISING, dcdc->name, dcdc); 735 IRQF_TRIGGER_RISING, dcdc->name, dcdc);
732 if (ret != 0) { 736 if (ret != 0) {
@@ -751,7 +755,8 @@ static __devexit int wm831x_buckp_remove(struct platform_device *pdev)
751 755
752 platform_set_drvdata(pdev, NULL); 756 platform_set_drvdata(pdev, NULL);
753 757
754 free_irq(platform_get_irq_byname(pdev, "UV"), dcdc); 758 free_irq(wm831x_irq(dcdc->wm831x, platform_get_irq_byname(pdev, "UV")),
759 dcdc);
755 regulator_unregister(dcdc->regulator); 760 regulator_unregister(dcdc->regulator);
756 761
757 return 0; 762 return 0;
@@ -859,7 +864,7 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev)
859 goto err; 864 goto err;
860 } 865 }
861 866
862 irq = platform_get_irq_byname(pdev, "UV"); 867 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
863 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_uv_irq, 868 ret = request_threaded_irq(irq, NULL, wm831x_dcdc_uv_irq,
864 IRQF_TRIGGER_RISING, dcdc->name, 869 IRQF_TRIGGER_RISING, dcdc->name,
865 dcdc); 870 dcdc);
@@ -885,7 +890,8 @@ static __devexit int wm831x_boostp_remove(struct platform_device *pdev)
885 890
886 platform_set_drvdata(pdev, NULL); 891 platform_set_drvdata(pdev, NULL);
887 892
888 free_irq(platform_get_irq_byname(pdev, "UV"), dcdc); 893 free_irq(wm831x_irq(dcdc->wm831x, platform_get_irq_byname(pdev, "UV")),
894 dcdc);
889 regulator_unregister(dcdc->regulator); 895 regulator_unregister(dcdc->regulator);
890 896
891 return 0; 897 return 0;