16 #include <linux/device.h>
17 #include <linux/kernel.h>
18 #include <linux/slab.h>
19 #include <linux/list.h>
20 #include <linux/module.h>
33 static void internal_container_klist_get(
struct klist_node *
n)
40 static void internal_container_klist_put(
struct klist_node *
n)
64 static LIST_HEAD(attribute_container_list);
77 INIT_LIST_HEAD(&cont->
node);
79 internal_container_klist_put);
153 if (attribute_container_no_classdevs(cont))
156 if (!cont->
match(cont, dev))
161 dev_printk(
KERN_ERR, dev,
"failed to allocate class container\n");
169 cont->
class->dev_release = attribute_container_release;
183 #define klist_for_each_entry(pos, head, member, iter) \
184 for (klist_iter_init(head, iter); (pos = ({ \
185 struct klist_node *n = klist_next(iter); \
186 n ? container_of(n, typeof(*pos), member) : \
187 ({ klist_iter_exit(iter) ; NULL; }); \
219 if (attribute_container_no_classdevs(cont))
222 if (!cont->
match(cont, dev))
263 if (!cont->
match(cont, dev))
266 if (attribute_container_no_classdevs(cont)) {
300 if (cont->
match(cont, dev))
324 if (!attrs && !cont->
grp)
330 for (i = 0; attrs[
i]; i++) {
386 if (!attrs && !cont->
grp)
394 for (i = 0; attrs[
i]; i++)