]> xenbits.xensource.com Git - people/aperard/linux-arndale.git/commitdiff
regulator: s5m8767: Fix to work even if no DVS gpio present
authorAmit Daniel Kachhap <amit.daniel@samsung.com>
Fri, 7 Dec 2012 06:17:12 +0000 (11:47 +0530)
committerVasanth Ananthan <vasanthananthan@gmail.com>
Tue, 8 Jan 2013 10:34:50 +0000 (16:04 +0530)
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
drivers/regulator/s5m8767.c

index 7ed7591be71db347bee3c92827223c800e53b9b5..3b6462513589abecbad51550017636d083c58634 100644 (file)
@@ -626,9 +626,16 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
                }
        }
 
-       if (gpio_is_valid(pdata->buck_gpios[0]) &&
-               gpio_is_valid(pdata->buck_gpios[1]) &&
-               gpio_is_valid(pdata->buck_gpios[2])) {
+       if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
+                                               pdata->buck4_gpiodvs) {
+
+               if (!gpio_is_valid(pdata->buck_gpios[0]) ||
+                       gpio_is_valid(pdata->buck_gpios[1]) ||
+                       gpio_is_valid(pdata->buck_gpios[2])) {
+                       dev_err(&pdev->dev, "GPIO NOT VALID\n");
+                       return -EINVAL;
+               }
+
                ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0],
                                        "S5M8767 SET1");
                if (ret)
@@ -653,10 +660,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
                /* SET3 GPIO */
                gpio_direction_output(pdata->buck_gpios[2],
                                (s5m8767->buck_gpioindex >> 0) & 0x1);
-       } else {
-               dev_err(&pdev->dev, "GPIO NOT VALID\n");
-               ret = -EINVAL;
-               return ret;
        }
 
        ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[0], "S5M8767 DS2");