diff options
Diffstat (limited to 'drivers/regulator/max8997.c')
-rw-r--r-- | drivers/regulator/max8997.c | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 704cd49ef375..e39a0c7260dc 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -1025,7 +1025,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1025 | */ | 1025 | */ |
1026 | if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || | 1026 | if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || |
1027 | pdata->buck5_gpiodvs) { | 1027 | pdata->buck5_gpiodvs) { |
1028 | bool gpio1set = false, gpio2set = false; | ||
1029 | 1028 | ||
1030 | if (!gpio_is_valid(pdata->buck125_gpios[0]) || | 1029 | if (!gpio_is_valid(pdata->buck125_gpios[0]) || |
1031 | !gpio_is_valid(pdata->buck125_gpios[1]) || | 1030 | !gpio_is_valid(pdata->buck125_gpios[1]) || |
@@ -1035,40 +1034,20 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1035 | goto err_out; | 1034 | goto err_out; |
1036 | } | 1035 | } |
1037 | 1036 | ||
1038 | ret = gpio_request(pdata->buck125_gpios[0], | 1037 | ret = devm_gpio_request(&pdev->dev, pdata->buck125_gpios[0], |
1039 | "MAX8997 SET1"); | 1038 | "MAX8997 SET1"); |
1040 | if (ret == -EBUSY) | 1039 | if (ret) |
1041 | dev_warn(&pdev->dev, "Duplicated gpio request" | ||
1042 | " on SET1\n"); | ||
1043 | else if (ret) | ||
1044 | goto err_out; | 1040 | goto err_out; |
1045 | else | 1041 | |
1046 | gpio1set = true; | 1042 | ret = devm_gpio_request(&pdev->dev, pdata->buck125_gpios[1], |
1047 | 1043 | "MAX8997 SET2"); | |
1048 | ret = gpio_request(pdata->buck125_gpios[1], | 1044 | if (ret) |
1049 | "MAX8997 SET2"); | ||
1050 | if (ret == -EBUSY) | ||
1051 | dev_warn(&pdev->dev, "Duplicated gpio request" | ||
1052 | " on SET2\n"); | ||
1053 | else if (ret) { | ||
1054 | if (gpio1set) | ||
1055 | gpio_free(pdata->buck125_gpios[0]); | ||
1056 | goto err_out; | 1045 | goto err_out; |
1057 | } else | ||
1058 | gpio2set = true; | ||
1059 | 1046 | ||
1060 | ret = gpio_request(pdata->buck125_gpios[2], | 1047 | ret = devm_gpio_request(&pdev->dev, pdata->buck125_gpios[2], |
1061 | "MAX8997 SET3"); | 1048 | "MAX8997 SET3"); |
1062 | if (ret == -EBUSY) | 1049 | if (ret) |
1063 | dev_warn(&pdev->dev, "Duplicated gpio request" | ||
1064 | " on SET3\n"); | ||
1065 | else if (ret) { | ||
1066 | if (gpio1set) | ||
1067 | gpio_free(pdata->buck125_gpios[0]); | ||
1068 | if (gpio2set) | ||
1069 | gpio_free(pdata->buck125_gpios[1]); | ||
1070 | goto err_out; | 1050 | goto err_out; |
1071 | } | ||
1072 | 1051 | ||
1073 | gpio_direction_output(pdata->buck125_gpios[0], | 1052 | gpio_direction_output(pdata->buck125_gpios[0], |
1074 | (max8997->buck125_gpioindex >> 2) | 1053 | (max8997->buck125_gpioindex >> 2) |
@@ -1079,7 +1058,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1079 | gpio_direction_output(pdata->buck125_gpios[2], | 1058 | gpio_direction_output(pdata->buck125_gpios[2], |
1080 | (max8997->buck125_gpioindex >> 0) | 1059 | (max8997->buck125_gpioindex >> 0) |
1081 | & 0x1); /* SET3 */ | 1060 | & 0x1); /* SET3 */ |
1082 | ret = 0; | ||
1083 | } | 1061 | } |
1084 | 1062 | ||
1085 | /* DVS-GPIO disabled */ | 1063 | /* DVS-GPIO disabled */ |