aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c10
-rw-r--r--arch/blackfin/mach-bf548/gpio.c11
2 files changed, 17 insertions, 4 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;
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)
212 int ret; 212 int ret;
213 213
214 for (cnt = 0; per[cnt] != 0; cnt++) { 214 for (cnt = 0; per[cnt] != 0; cnt++) {
215
215 ret = peripheral_request(per[cnt], label); 216 ret = peripheral_request(per[cnt], label);
216 if (ret < 0) 217
217 return ret; 218 if (ret < 0) {
219 for ( ; cnt > 0; cnt--) {
220 peripheral_free(per[cnt - 1]);
221 }
222 return ret;
223 }
218 } 224 }
219 225
226
220 return 0; 227 return 0;
221} 228}
222EXPORT_SYMBOL(peripheral_request_list); 229EXPORT_SYMBOL(peripheral_request_list);