未验证 提交 f5694369 编写于 作者: V Vladimir Zapolskiy 提交者: Mark Brown

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: NVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 ebc37af5
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册