aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf548
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2007-07-24 18:03:45 +0800
committerBryan Wu <bryan.wu@analog.com>2007-07-24 18:03:45 +0800
commit314c98d589b9da40af42cfe7213eff04c74caea3 (patch)
tree3c91afc0d6b0f0150aa7f545c0060f96d751a9d4 /arch/blackfin/mach-bf548
parentBlackfin arch: Fix define - SPORT0_DTPRI is first function (diff)
downloadlinux-dev-314c98d589b9da40af42cfe7213eff04c74caea3.tar.xz
linux-dev-314c98d589b9da40af42cfe7213eff04c74caea3.zip
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/mach-bf548')
-rw-r--r--arch/blackfin/mach-bf548/gpio.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/blackfin/mach-bf548/gpio.c b/arch/blackfin/mach-bf548/gpio.c
index c073ab36066d..f3b9deacd332 100644
--- a/arch/blackfin/mach-bf548/gpio.c
+++ b/arch/blackfin/mach-bf548/gpio.c
@@ -212,11 +212,18 @@ int peripheral_request_list(unsigned short per[], const char *label)
int ret;
for (cnt = 0; per[cnt] != 0; cnt++) {
+
ret = peripheral_request(per[cnt], label);
- if (ret < 0)
- return ret;
+
+ if (ret < 0) {
+ for ( ; cnt > 0; cnt--) {
+ peripheral_free(per[cnt - 1]);
+ }
+ return ret;
+ }
}
+
return 0;
}
EXPORT_SYMBOL(peripheral_request_list);