ASoC: sprd: Switch to use list_entry_is_head() helper

Since we got list_entry_is_head() helper in the generic header,
we may switch driver to use it. This eliminates the need
in additional variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20201208111805.6989-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Andy Shevchenko 2020-12-08 13:18:05 +02:00 committed by Mark Brown
parent 6bdd75a1f6
commit 57fc2bbc62
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 5 additions and 5 deletions

View File

@ -866,23 +866,23 @@ EXPORT_SYMBOL_GPL(sprd_mcdt_chan_dma_disable);
struct sprd_mcdt_chan *sprd_mcdt_request_chan(u8 channel,
enum sprd_mcdt_channel_type type)
{
struct sprd_mcdt_chan *temp, *chan = NULL;
struct sprd_mcdt_chan *temp;
mutex_lock(&sprd_mcdt_list_mutex);
list_for_each_entry(temp, &sprd_mcdt_chan_list, list) {
if (temp->type == type && temp->id == channel) {
chan = temp;
list_del_init(&temp->list);
break;
}
}
if (chan)
list_del(&chan->list);
if (list_entry_is_head(temp, &sprd_mcdt_chan_list, list))
temp = NULL;
mutex_unlock(&sprd_mcdt_list_mutex);
return chan;
return temp;
}
EXPORT_SYMBOL_GPL(sprd_mcdt_request_chan);