aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 4fd899bd2c0d..c0a126125325 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -25,6 +25,7 @@
25#include <linux/pm.h> 25#include <linux/pm.h>
26#include <linux/atomic.h> 26#include <linux/atomic.h>
27#include <linux/ratelimit.h> 27#include <linux/ratelimit.h>
28#include <linux/uidgid.h>
28#include <asm/device.h> 29#include <asm/device.h>
29 30
30struct device; 31struct device;
@@ -111,17 +112,11 @@ struct bus_type {
111 struct iommu_ops *iommu_ops; 112 struct iommu_ops *iommu_ops;
112 113
113 struct subsys_private *p; 114 struct subsys_private *p;
115 struct lock_class_key lock_key;
114}; 116};
115 117
116/* This is a #define to keep the compiler from merging different 118extern int __must_check bus_register(struct bus_type *bus);
117 * instances of the __key variable */ 119
118#define bus_register(subsys) \
119({ \
120 static struct lock_class_key __key; \
121 __bus_register(subsys, &__key); \
122})
123extern int __must_check __bus_register(struct bus_type *bus,
124 struct lock_class_key *key);
125extern void bus_unregister(struct bus_type *bus); 120extern void bus_unregister(struct bus_type *bus);
126 121
127extern int __must_check bus_rescan_devices(struct bus_type *bus); 122extern int __must_check bus_rescan_devices(struct bus_type *bus);
@@ -302,6 +297,8 @@ void subsys_interface_unregister(struct subsys_interface *sif);
302 297
303int subsys_system_register(struct bus_type *subsys, 298int subsys_system_register(struct bus_type *subsys,
304 const struct attribute_group **groups); 299 const struct attribute_group **groups);
300int subsys_virtual_register(struct bus_type *subsys,
301 const struct attribute_group **groups);
305 302
306/** 303/**
307 * struct class - device classes 304 * struct class - device classes
@@ -471,7 +468,8 @@ struct device_type {
471 const char *name; 468 const char *name;
472 const struct attribute_group **groups; 469 const struct attribute_group **groups;
473 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 470 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
474 char *(*devnode)(struct device *dev, umode_t *mode); 471 char *(*devnode)(struct device *dev, umode_t *mode,
472 kuid_t *uid, kgid_t *gid);
475 void (*release)(struct device *dev); 473 void (*release)(struct device *dev);
476 474
477 const struct dev_pm_ops *pm; 475 const struct dev_pm_ops *pm;
@@ -853,7 +851,8 @@ extern int device_rename(struct device *dev, const char *new_name);
853extern int device_move(struct device *dev, struct device *new_parent, 851extern int device_move(struct device *dev, struct device *new_parent,
854 enum dpm_order dpm_order); 852 enum dpm_order dpm_order);
855extern const char *device_get_devnode(struct device *dev, 853extern const char *device_get_devnode(struct device *dev,
856 umode_t *mode, const char **tmp); 854 umode_t *mode, kuid_t *uid, kgid_t *gid,
855 const char **tmp);
857extern void *dev_get_drvdata(const struct device *dev); 856extern void *dev_get_drvdata(const struct device *dev);
858extern int dev_set_drvdata(struct device *dev, void *data); 857extern int dev_set_drvdata(struct device *dev, void *data);
859 858