hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/resource_ext.h
....@@ -1,15 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2015, Intel Corporation
34 * 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.
135 */
146 #ifndef _LINUX_RESOURCE_EXT_H
157 #define _LINUX_RESOURCE_EXT_H
....@@ -74,4 +66,16 @@
7466 #define resource_list_for_each_entry_safe(entry, tmp, list) \
7567 list_for_each_entry_safe((entry), (tmp), (list), node)
7668
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
+
7781 #endif /* _LINUX_RESOURCE_EXT_H */