Blame view
include/linux/of_device.h
1.62 KB
f898f8dbc
|
1 2 |
#ifndef _LINUX_OF_DEVICE_H #define _LINUX_OF_DEVICE_H |
f898f8dbc
|
3 |
|
f9f5a4669
|
4 |
#include <linux/platform_device.h> |
295960429
|
5 |
#include <linux/of_platform.h> /* temporary until merge */ |
b505ff5e7
|
6 |
|
f9f5a4669
|
7 8 9 10 |
#ifdef CONFIG_OF_DEVICE #include <linux/device.h> #include <linux/of.h> #include <linux/mod_devicetable.h> |
f898f8dbc
|
11 |
|
f898f8dbc
|
12 |
extern const struct of_device_id *of_match_device( |
44504b2be
|
13 |
const struct of_device_id *matches, const struct device *dev); |
c66012253
|
14 |
extern void of_device_make_bus_id(struct device *dev); |
f898f8dbc
|
15 |
|
8cec0e7b4
|
16 17 18 19 20 21 22 23 24 25 |
/** * of_driver_match_device - Tell if a driver's of_match_table matches a device. * @drv: the device_driver structure to test * @dev: the device structure to match against */ static inline int of_driver_match_device(const struct device *dev, const struct device_driver *drv) { return of_match_device(drv->of_match_table, dev) != NULL; } |
94a0cb1fc
|
26 27 |
extern struct platform_device *of_dev_get(struct platform_device *dev); extern void of_dev_put(struct platform_device *dev); |
f898f8dbc
|
28 |
|
94a0cb1fc
|
29 30 |
extern int of_device_register(struct platform_device *ofdev); extern void of_device_unregister(struct platform_device *ofdev); |
f898f8dbc
|
31 |
extern void of_release_dev(struct device *dev); |
94a0cb1fc
|
32 |
static inline void of_device_free(struct platform_device *dev) |
fec738dd4
|
33 34 35 |
{ of_release_dev(&dev->dev); } |
34a1c1e8c
|
36 |
extern ssize_t of_device_get_modalias(struct device *dev, |
09e67ca2c
|
37 |
char *str, ssize_t len); |
dd27dcda3
|
38 39 |
extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); |
8cec0e7b4
|
40 41 42 43 44 45 46 |
#else /* CONFIG_OF_DEVICE */ static inline int of_driver_match_device(struct device *dev, struct device_driver *drv) { return 0; } |
eca393016
|
47 48 49 50 51 |
static inline int of_device_uevent(struct device *dev, struct kobj_uevent_env *env) { return -ENODEV; } |
efb2e014f
|
52 |
#endif /* CONFIG_OF_DEVICE */ |
09e67ca2c
|
53 |
|
f898f8dbc
|
54 |
#endif /* _LINUX_OF_DEVICE_H */ |