]> git.neil.brown.name Git - gta04.git/commit
regulator: max8997: Properly handle gpio_request failure
authorAxel Lin <axel.lin@gmail.com>
Thu, 5 Jul 2012 15:06:57 +0000 (23:06 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 15 Jul 2012 20:49:53 +0000 (21:49 +0100)
commit8fa25eda86b1a149fd19b5ce80d8cf7b6c8fb566
tree6d55a3d26f23d85ca2a4da11d66a2f86db77b53b
parent8a8e3d5915b3b40a64a5e7dc5aeb208594917a15
regulator: max8997: Properly handle gpio_request failure

Convert to devm_gpio_request to save a few error handling code.

This patch properly handle the gpio_request failure with -EBUSY, we should
return error rather than ommit the gpio_request failure with -EBUSY.

I think one of the reason we got -EBUSY is because current code does not free
gpios in max8997_pmic_remove(). So it got -EBUSY when reload the module.

Yest another reason is in current code if gpio_request() returns -EBUSY,
the rest of the code still calls gpio_direction_output to config buck125_gpios
and set gpio value in max8997_set_gpio().  This looks wrong to me.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/max8997.c