Commit 314c98d5 authored by Michael Hennerich's avatar Michael Hennerich Committed by Bryan Wu

Blackfin arch: add missing gpio error handling to make sure we roll back requests in case one fails

Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
parent 06039e90
......@@ -711,9 +711,15 @@ 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;
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment