mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 11:06:39 +07:00
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>
This commit is contained in:
parent
06039e90b9
commit
314c98d589
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user