mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
spi: don't open code list_for_each_entry_safe_reverse()
The loop declaration in function spi_res_release() can be simplified by reusing the common list_for_each_entry_safe_reverse() helper macro. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
ebc37af5e0
commit
f569436994
1 changed files with 2 additions and 5 deletions
|
|
@ -2721,12 +2721,9 @@ EXPORT_SYMBOL_GPL(spi_res_add);
|
|||
*/
|
||||
void spi_res_release(struct spi_controller *ctlr, struct spi_message *message)
|
||||
{
|
||||
struct spi_res *res;
|
||||
|
||||
while (!list_empty(&message->resources)) {
|
||||
res = list_last_entry(&message->resources,
|
||||
struct spi_res, entry);
|
||||
struct spi_res *res, *tmp;
|
||||
|
||||
list_for_each_entry_safe_reverse(res, tmp, &message->resources, entry) {
|
||||
if (res->release)
|
||||
res->release(ctlr, message, res->data);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue