aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/bfin_gpio.c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2007-07-24 06:03:45 -0400
committerBryan Wu <bryan.wu@analog.com>2007-07-24 06:03:45 -0400
commit314c98d589b9da40af42cfe7213eff04c74caea3 (patch)
tree3c91afc0d6b0f0150aa7f545c0060f96d751a9d4 /arch/blackfin/kernel/bfin_gpio.c
parent06039e90b90af4029184d577b3c66e59f6039a9e (diff)
Blackfin arch: add missing gpio error handling to make sure we roll back requests in case one fails
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel/bfin_gpio.c')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index b818a8da1215..979cf79d3799 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -711,9 +711,15 @@ int peripheral_request_list(unsigned short per[], const char *label)
711 int ret; 711 int ret;
712 712
713 for (cnt = 0; per[cnt] != 0; cnt++) { 713 for (cnt = 0; per[cnt] != 0; cnt++) {
714
714 ret = peripheral_request(per[cnt], label); 715 ret = peripheral_request(per[cnt], label);
715 if (ret < 0) 716
716 return ret; 717 if (ret < 0) {
718 for ( ; cnt > 0; cnt--) {
719 peripheral_free(per[cnt - 1]);
720 }
721 return ret;
722 }
717 } 723 }
718 724
719 return 0; 725 return 0;