From: Axel Lin Date: Thu, 5 Jul 2012 15:06:57 +0000 (+0800) Subject: regulator: max8997: Properly handle gpio_request failure X-Git-Tag: v3.6-rc1~157^2^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fa25eda86b1a149fd19b5ce80d8cf7b6c8fb566;p=pandora-kernel.git 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 Signed-off-by: Mark Brown --- Reading git-diff-tree failed