aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of_device.h
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-02-01 13:22:22 -0500
committerGrant Likely <grant.likely@secretlab.ca>2012-02-01 16:26:30 -0500
commit07d57a32fb6eb2da017796e038682f817a4f685e (patch)
tree4c7bb83cbda8db99ed91f575d8355c5b45b16cfb /include/linux/of_device.h
parent7aff0fe33033fc75b61446ba29d38b1b1354af9f (diff)
drivercore: Output common devicetree information in uevent
When userspace needs to find a specific device, it currently isn't easy to resolve a /sys/devices/ path from a specific device tree node. Nor is it easy to obtain the compatible list for devices. This patch generalizes the code that inserts OF_* values into the uevent device attribute so that any device that is attached to an OF node will have that information exported to userspace. Without this patch only platform devices and some powerpc-specific busses have access to this data. The original function also creates a MODALIAS property for the compatible list, but that code has not been generalized into the common case because it has the potential to break module loading on a lot of bus types. Bus types are still responsible for their own MODALIAS properties. Boot tested on ARM and compile tested on PowerPC and SPARC. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Frederic Lambert <frdrc66@gmail.com> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Mark Brown <broonie@sirena.org.uk> Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/linux/of_device.h')
-rw-r--r--include/linux/of_device.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index ae5638480ef..cbc42143fa5 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -34,7 +34,8 @@ extern void of_device_unregister(struct platform_device *ofdev);
34extern ssize_t of_device_get_modalias(struct device *dev, 34extern ssize_t of_device_get_modalias(struct device *dev,
35 char *str, ssize_t len); 35 char *str, ssize_t len);
36 36
37extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); 37extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
38extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env);
38 39
39static inline void of_device_node_put(struct device *dev) 40static inline void of_device_node_put(struct device *dev)
40{ 41{
@@ -49,7 +50,10 @@ static inline int of_driver_match_device(struct device *dev,
49 return 0; 50 return 0;
50} 51}
51 52
52static inline int of_device_uevent(struct device *dev, 53static inline void of_device_uevent(struct device *dev,
54 struct kobj_uevent_env *env) { }
55
56static inline int of_device_uevent_modalias(struct device *dev,
53 struct kobj_uevent_env *env) 57 struct kobj_uevent_env *env)
54{ 58{
55 return -ENODEV; 59 return -ENODEV;