From 0888fdafaaf40e380186bafb3f3cc436063b516a Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 5 Jul 2012 23:06:57 +0800 Subject: [PATCH] --- yaml --- r: 312636 b: refs/heads/master c: 8fa25eda86b1a149fd19b5ce80d8cf7b6c8fb566 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/regulator/max8997.c | 40 +++++++------------------------ 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/[refs] b/[refs] index 35f85e05bf9d..ccbf99f73cb3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8a8e3d5915b3b40a64a5e7dc5aeb208594917a15 +refs/heads/master: 8fa25eda86b1a149fd19b5ce80d8cf7b6c8fb566 diff --git a/trunk/drivers/regulator/max8997.c b/trunk/drivers/regulator/max8997.c index 704cd49ef375..e39a0c7260dc 100644 --- a/trunk/drivers/regulator/max8997.c +++ b/trunk/drivers/regulator/max8997.c @@ -1025,7 +1025,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) */ if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || pdata->buck5_gpiodvs) { - bool gpio1set = false, gpio2set = false; if (!gpio_is_valid(pdata->buck125_gpios[0]) || !gpio_is_valid(pdata->buck125_gpios[1]) || @@ -1035,40 +1034,20 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) goto err_out; } - ret = gpio_request(pdata->buck125_gpios[0], - "MAX8997 SET1"); - if (ret == -EBUSY) - dev_warn(&pdev->dev, "Duplicated gpio request" - " on SET1\n"); - else if (ret) + ret = devm_gpio_request(&pdev->dev, pdata->buck125_gpios[0], + "MAX8997 SET1"); + if (ret) goto err_out; - else - gpio1set = true; - - ret = gpio_request(pdata->buck125_gpios[1], - "MAX8997 SET2"); - if (ret == -EBUSY) - dev_warn(&pdev->dev, "Duplicated gpio request" - " on SET2\n"); - else if (ret) { - if (gpio1set) - gpio_free(pdata->buck125_gpios[0]); + + ret = devm_gpio_request(&pdev->dev, pdata->buck125_gpios[1], + "MAX8997 SET2"); + if (ret) goto err_out; - } else - gpio2set = true; - ret = gpio_request(pdata->buck125_gpios[2], + ret = devm_gpio_request(&pdev->dev, pdata->buck125_gpios[2], "MAX8997 SET3"); - if (ret == -EBUSY) - dev_warn(&pdev->dev, "Duplicated gpio request" - " on SET3\n"); - else if (ret) { - if (gpio1set) - gpio_free(pdata->buck125_gpios[0]); - if (gpio2set) - gpio_free(pdata->buck125_gpios[1]); + if (ret) goto err_out; - } gpio_direction_output(pdata->buck125_gpios[0], (max8997->buck125_gpioindex >> 2) @@ -1079,7 +1058,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) gpio_direction_output(pdata->buck125_gpios[2], (max8997->buck125_gpioindex >> 0) & 0x1); /* SET3 */ - ret = 0; } /* DVS-GPIO disabled */