diff options
-rw-r--r-- | drivers/mfd/ab8500-gpadc.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index b1f3561b023f..5f341a50ee5a 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c | |||
@@ -594,9 +594,12 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev) | |||
594 | static int ab8500_gpadc_runtime_resume(struct device *dev) | 594 | static int ab8500_gpadc_runtime_resume(struct device *dev) |
595 | { | 595 | { |
596 | struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); | 596 | struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); |
597 | int ret; | ||
597 | 598 | ||
598 | regulator_enable(gpadc->regu); | 599 | ret = regulator_enable(gpadc->regu); |
599 | return 0; | 600 | if (ret) |
601 | dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret); | ||
602 | return ret; | ||
600 | } | 603 | } |
601 | 604 | ||
602 | static int ab8500_gpadc_runtime_idle(struct device *dev) | 605 | static int ab8500_gpadc_runtime_idle(struct device *dev) |
@@ -643,7 +646,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) | |||
643 | } | 646 | } |
644 | 647 | ||
645 | /* VTVout LDO used to power up ab8500-GPADC */ | 648 | /* VTVout LDO used to power up ab8500-GPADC */ |
646 | gpadc->regu = regulator_get(&pdev->dev, "vddadc"); | 649 | gpadc->regu = devm_regulator_get(&pdev->dev, "vddadc"); |
647 | if (IS_ERR(gpadc->regu)) { | 650 | if (IS_ERR(gpadc->regu)) { |
648 | ret = PTR_ERR(gpadc->regu); | 651 | ret = PTR_ERR(gpadc->regu); |
649 | dev_err(gpadc->dev, "failed to get vtvout LDO\n"); | 652 | dev_err(gpadc->dev, "failed to get vtvout LDO\n"); |
@@ -652,7 +655,11 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) | |||
652 | 655 | ||
653 | platform_set_drvdata(pdev, gpadc); | 656 | platform_set_drvdata(pdev, gpadc); |
654 | 657 | ||
655 | regulator_enable(gpadc->regu); | 658 | ret = regulator_enable(gpadc->regu); |
659 | if (ret) { | ||
660 | dev_err(gpadc->dev, "Failed to enable vtvout LDO: %d\n", ret); | ||
661 | goto fail_enable; | ||
662 | } | ||
656 | 663 | ||
657 | pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY); | 664 | pm_runtime_set_autosuspend_delay(gpadc->dev, GPADC_AUDOSUSPEND_DELAY); |
658 | pm_runtime_use_autosuspend(gpadc->dev); | 665 | pm_runtime_use_autosuspend(gpadc->dev); |
@@ -663,6 +670,8 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) | |||
663 | list_add_tail(&gpadc->node, &ab8500_gpadc_list); | 670 | list_add_tail(&gpadc->node, &ab8500_gpadc_list); |
664 | dev_dbg(gpadc->dev, "probe success\n"); | 671 | dev_dbg(gpadc->dev, "probe success\n"); |
665 | return 0; | 672 | return 0; |
673 | |||
674 | fail_enable: | ||
666 | fail_irq: | 675 | fail_irq: |
667 | free_irq(gpadc->irq, gpadc); | 676 | free_irq(gpadc->irq, gpadc); |
668 | fail: | 677 | fail: |