summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-04-06 20:56:00 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-08 19:21:48 +0400
commit3c2670e6515cf584810f417db9b00992c8b2d75a (patch)
treebc13c7babc6c8f08b6a82d0b3848778b264d9651 /include/linux/device.h
parentbb2b0051d7b0772ea9d0b4be900c2d965093f5d7 (diff)
downloadlinux-3c2670e6515cf584810f417db9b00992c8b2d75a.tar.xz
driver core: add uid and gid to devtmpfs
Some drivers want to tell userspace what uid and gid should be used for their device nodes, so allow that information to percolate through the driver core to userspace in order to make this happen. This means that some systems (i.e. Android and friends) will not need to even run a udev-like daemon for their device node manager and can just rely in devtmpfs fully, reducing their footprint even more. Signed-off-by: Kay Sievers <kay@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 4a7c4a84afee..851b85c7101e 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -25,6 +25,7 @@
#include <linux/pm.h>
#include <linux/atomic.h>
#include <linux/ratelimit.h>
+#include <linux/uidgid.h>
#include <asm/device.h>
struct device;
@@ -465,7 +466,8 @@ struct device_type {
const char *name;
const struct attribute_group **groups;
int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
- char *(*devnode)(struct device *dev, umode_t *mode);
+ char *(*devnode)(struct device *dev, umode_t *mode,
+ uid_t *uid, gid_t *gid);
void (*release)(struct device *dev);
const struct dev_pm_ops *pm;
@@ -843,7 +845,8 @@ extern int device_rename(struct device *dev, const char *new_name);
extern int device_move(struct device *dev, struct device *new_parent,
enum dpm_order dpm_order);
extern const char *device_get_devnode(struct device *dev,
- umode_t *mode, const char **tmp);
+ umode_t *mode, uid_t *uid, gid_t *gid,
+ const char **tmp);
extern void *dev_get_drvdata(const struct device *dev);
extern int dev_set_drvdata(struct device *dev, void *data);