| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2015, Intel Corporation |
|---|
| 3 | 4 | * Author: Jiang Liu <jiang.liu@linux.intel.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 7 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 12 | | - * more details. |
|---|
| 13 | 5 | */ |
|---|
| 14 | 6 | #ifndef _LINUX_RESOURCE_EXT_H |
|---|
| 15 | 7 | #define _LINUX_RESOURCE_EXT_H |
|---|
| .. | .. |
|---|
| 74 | 66 | #define resource_list_for_each_entry_safe(entry, tmp, list) \ |
|---|
| 75 | 67 | list_for_each_entry_safe((entry), (tmp), (list), node) |
|---|
| 76 | 68 | |
|---|
| 69 | +static inline struct resource_entry * |
|---|
| 70 | +resource_list_first_type(struct list_head *list, unsigned long type) |
|---|
| 71 | +{ |
|---|
| 72 | + struct resource_entry *entry; |
|---|
| 73 | + |
|---|
| 74 | + resource_list_for_each_entry(entry, list) { |
|---|
| 75 | + if (resource_type(entry->res) == type) |
|---|
| 76 | + return entry; |
|---|
| 77 | + } |
|---|
| 78 | + return NULL; |
|---|
| 79 | +} |
|---|
| 80 | + |
|---|
| 77 | 81 | #endif /* _LINUX_RESOURCE_EXT_H */ |
|---|