Pull out string hash to <linux/stringhash.h>
[linux-2.6-block.git] / include / linux / component.h
CommitLineData
2a41e607
RK
1#ifndef COMPONENT_H
2#define COMPONENT_H
3
ce657b1c
RK
4#include <linux/stddef.h>
5
2a41e607
RK
6struct device;
7
8struct component_ops {
ce657b1c
RK
9 int (*bind)(struct device *comp, struct device *master,
10 void *master_data);
11 void (*unbind)(struct device *comp, struct device *master,
12 void *master_data);
2a41e607
RK
13};
14
15int component_add(struct device *, const struct component_ops *);
16void component_del(struct device *, const struct component_ops *);
17
ce657b1c
RK
18int component_bind_all(struct device *master, void *master_data);
19void component_unbind_all(struct device *master, void *master_data);
2a41e607
RK
20
21struct master;
22
23struct component_master_ops {
ce657b1c
RK
24 int (*bind)(struct device *master);
25 void (*unbind)(struct device *master);
2a41e607
RK
26};
27
2a41e607
RK
28void component_master_del(struct device *,
29 const struct component_master_ops *);
30
6955b582
RK
31struct component_match;
32
33int component_master_add_with_match(struct device *,
34 const struct component_master_ops *, struct component_match *);
ce657b1c
RK
35void component_match_add_release(struct device *master,
36 struct component_match **matchptr,
37 void (*release)(struct device *, void *),
6955b582
RK
38 int (*compare)(struct device *, void *), void *compare_data);
39
ce657b1c
RK
40static inline void component_match_add(struct device *master,
41 struct component_match **matchptr,
42 int (*compare)(struct device *, void *), void *compare_data)
43{
44 component_match_add_release(master, matchptr, NULL, compare,
45 compare_data);
46}
47
2a41e607 48#endif