1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_OF_DEVICE_H
3 #define _LINUX_OF_DEVICE_H
5 #include <linux/platform_device.h>
6 #include <linux/of_platform.h> /* temporary until merge */
12 struct kobj_uevent_env;
15 extern const struct of_device_id *of_match_device(
16 const struct of_device_id *matches, const struct device *dev);
19 * of_driver_match_device - Tell if a driver's of_match_table matches a device.
20 * @drv: the device_driver structure to test
21 * @dev: the device structure to match against
23 static inline int of_driver_match_device(struct device *dev,
24 const struct device_driver *drv)
26 return of_match_device(drv->of_match_table, dev) != NULL;
29 extern ssize_t of_device_modalias(struct device *dev, char *str, ssize_t len);
31 extern void of_device_uevent(const struct device *dev, struct kobj_uevent_env *env);
32 extern int of_device_uevent_modalias(const struct device *dev, struct kobj_uevent_env *env);
34 int of_dma_configure_id(struct device *dev,
35 struct device_node *np,
36 bool force_dma, const u32 *id);
37 static inline int of_dma_configure(struct device *dev,
38 struct device_node *np,
41 return of_dma_configure_id(dev, np, force_dma, NULL);
45 static inline int of_driver_match_device(struct device *dev,
46 const struct device_driver *drv)
51 static inline void of_device_uevent(const struct device *dev,
52 struct kobj_uevent_env *env) { }
54 static inline int of_device_modalias(struct device *dev,
55 char *str, ssize_t len)
60 static inline int of_device_uevent_modalias(const struct device *dev,
61 struct kobj_uevent_env *env)
66 static inline const struct of_device_id *of_match_device(
67 const struct of_device_id *matches, const struct device *dev)
72 static inline int of_dma_configure_id(struct device *dev,
73 struct device_node *np,
79 static inline int of_dma_configure(struct device *dev,
80 struct device_node *np,
85 #endif /* CONFIG_OF */
87 #endif /* _LINUX_OF_DEVICE_H */