diff options
author | Amit Daniel Kachhap <amit.daniel@samsung.com> | 2012-12-10 07:49:41 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-10 22:44:05 -0500 |
commit | 76c854d1dfdce33354dc2481e5db31f27c6be3e3 (patch) | |
tree | a211a11d8ec7b3cc282efbd4c0ef411c312ee47b /drivers/regulator | |
parent | da130ab2dfd5201d5c09e83882f30d62f29ab5f5 (diff) |
regulator: s5m8767: Fix to work even if no DVS gpio present
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/s5m8767.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 4afca9d570d2..8ef5b337ad65 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c | |||
@@ -626,9 +626,16 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev) | |||
626 | } | 626 | } |
627 | } | 627 | } |
628 | 628 | ||
629 | if (gpio_is_valid(pdata->buck_gpios[0]) && | 629 | if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs || |
630 | gpio_is_valid(pdata->buck_gpios[1]) && | 630 | pdata->buck4_gpiodvs) { |
631 | gpio_is_valid(pdata->buck_gpios[2])) { | 631 | |
632 | if (!gpio_is_valid(pdata->buck_gpios[0]) || | ||
633 | !gpio_is_valid(pdata->buck_gpios[1]) || | ||
634 | !gpio_is_valid(pdata->buck_gpios[2])) { | ||
635 | dev_err(&pdev->dev, "GPIO NOT VALID\n"); | ||
636 | return -EINVAL; | ||
637 | } | ||
638 | |||
632 | ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0], | 639 | ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0], |
633 | "S5M8767 SET1"); | 640 | "S5M8767 SET1"); |
634 | if (ret) | 641 | if (ret) |
@@ -653,10 +660,6 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev) | |||
653 | /* SET3 GPIO */ | 660 | /* SET3 GPIO */ |
654 | gpio_direction_output(pdata->buck_gpios[2], | 661 | gpio_direction_output(pdata->buck_gpios[2], |
655 | (s5m8767->buck_gpioindex >> 0) & 0x1); | 662 | (s5m8767->buck_gpioindex >> 0) & 0x1); |
656 | } else { | ||
657 | dev_err(&pdev->dev, "GPIO NOT VALID\n"); | ||
658 | ret = -EINVAL; | ||
659 | return ret; | ||
660 | } | 663 | } |
661 | 664 | ||
662 | ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[0], "S5M8767 DS2"); | 665 | ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[0], "S5M8767 DS2"); |