diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-23 20:24:48 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:54:55 -0500 |
commit | 2c9ede55ecec58099b72e4bb8eab719f32f72c31 (patch) | |
tree | 8498a8c940fea97931b469fc73eb1a5022a2b28c /drivers | |
parent | 7d54fa6472609f2b0f2ea27e51ec2cf1fb27bd57 (diff) |
switch device_get_devnode() and ->devnode() to umode_t *
both callers of device_get_devnode() are only interested in lower 16bits
and nobody tries to return anything wider than 16bit anyway.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/core.c | 4 | ||||
-rw-r--r-- | drivers/base/devtmpfs.c | 2 | ||||
-rw-r--r-- | drivers/block/aoe/aoechr.c | 2 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 2 | ||||
-rw-r--r-- | drivers/char/mem.c | 4 | ||||
-rw-r--r-- | drivers/char/misc.c | 2 | ||||
-rw-r--r-- | drivers/char/raw.c | 2 | ||||
-rw-r--r-- | drivers/char/tile-srom.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_sysfs.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/core/cm.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/core/user_mad.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/core/uverbs_main.c | 2 | ||||
-rw-r--r-- | drivers/input/input.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/ddbridge/ddbridge-core.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 2 | ||||
-rw-r--r-- | drivers/media/rc/rc-main.c | 2 | ||||
-rw-r--r-- | drivers/tty/tty_io.c | 2 | ||||
-rw-r--r-- | drivers/usb/class/usblp.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/file.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 2 | ||||
-rw-r--r-- | drivers/usb/misc/iowarrior.c | 2 | ||||
-rw-r--r-- | drivers/usb/misc/legousbtower.c | 2 |
23 files changed, 25 insertions, 25 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 919daa7cd5b1..1dfa1d616fa5 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -198,7 +198,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, | |||
198 | if (MAJOR(dev->devt)) { | 198 | if (MAJOR(dev->devt)) { |
199 | const char *tmp; | 199 | const char *tmp; |
200 | const char *name; | 200 | const char *name; |
201 | mode_t mode = 0; | 201 | umode_t mode = 0; |
202 | 202 | ||
203 | add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); | 203 | add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); |
204 | add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); | 204 | add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); |
@@ -1182,7 +1182,7 @@ static struct device *next_device(struct klist_iter *i) | |||
1182 | * freed by the caller. | 1182 | * freed by the caller. |
1183 | */ | 1183 | */ |
1184 | const char *device_get_devnode(struct device *dev, | 1184 | const char *device_get_devnode(struct device *dev, |
1185 | mode_t *mode, const char **tmp) | 1185 | umode_t *mode, const char **tmp) |
1186 | { | 1186 | { |
1187 | char *s; | 1187 | char *s; |
1188 | 1188 | ||
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index a4760e095ff5..3990f682e690 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c | |||
@@ -40,7 +40,7 @@ static struct req { | |||
40 | struct completion done; | 40 | struct completion done; |
41 | int err; | 41 | int err; |
42 | const char *name; | 42 | const char *name; |
43 | mode_t mode; /* 0 => delete */ | 43 | umode_t mode; /* 0 => delete */ |
44 | struct device *dev; | 44 | struct device *dev; |
45 | } *requests; | 45 | } *requests; |
46 | 46 | ||
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c index 5f8e39c43ae5..e86d2062a164 100644 --- a/drivers/block/aoe/aoechr.c +++ b/drivers/block/aoe/aoechr.c | |||
@@ -270,7 +270,7 @@ static const struct file_operations aoe_fops = { | |||
270 | .llseek = noop_llseek, | 270 | .llseek = noop_llseek, |
271 | }; | 271 | }; |
272 | 272 | ||
273 | static char *aoe_devnode(struct device *dev, mode_t *mode) | 273 | static char *aoe_devnode(struct device *dev, umode_t *mode) |
274 | { | 274 | { |
275 | return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); | 275 | return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); |
276 | } | 276 | } |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index a63b0a2b7805..d59edeabd93f 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -2817,7 +2817,7 @@ static const struct block_device_operations pktcdvd_ops = { | |||
2817 | .check_events = pkt_check_events, | 2817 | .check_events = pkt_check_events, |
2818 | }; | 2818 | }; |
2819 | 2819 | ||
2820 | static char *pktcdvd_devnode(struct gendisk *gd, mode_t *mode) | 2820 | static char *pktcdvd_devnode(struct gendisk *gd, umode_t *mode) |
2821 | { | 2821 | { |
2822 | return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); | 2822 | return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); |
2823 | } | 2823 | } |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 145179033716..d6e9d081c8b1 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -847,7 +847,7 @@ static const struct file_operations kmsg_fops = { | |||
847 | 847 | ||
848 | static const struct memdev { | 848 | static const struct memdev { |
849 | const char *name; | 849 | const char *name; |
850 | mode_t mode; | 850 | umode_t mode; |
851 | const struct file_operations *fops; | 851 | const struct file_operations *fops; |
852 | struct backing_dev_info *dev_info; | 852 | struct backing_dev_info *dev_info; |
853 | } devlist[] = { | 853 | } devlist[] = { |
@@ -901,7 +901,7 @@ static const struct file_operations memory_fops = { | |||
901 | .llseek = noop_llseek, | 901 | .llseek = noop_llseek, |
902 | }; | 902 | }; |
903 | 903 | ||
904 | static char *mem_devnode(struct device *dev, mode_t *mode) | 904 | static char *mem_devnode(struct device *dev, umode_t *mode) |
905 | { | 905 | { |
906 | if (mode && devlist[MINOR(dev->devt)].mode) | 906 | if (mode && devlist[MINOR(dev->devt)].mode) |
907 | *mode = devlist[MINOR(dev->devt)].mode; | 907 | *mode = devlist[MINOR(dev->devt)].mode; |
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 778273c93242..522136d40843 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -258,7 +258,7 @@ int misc_deregister(struct miscdevice *misc) | |||
258 | EXPORT_SYMBOL(misc_register); | 258 | EXPORT_SYMBOL(misc_register); |
259 | EXPORT_SYMBOL(misc_deregister); | 259 | EXPORT_SYMBOL(misc_deregister); |
260 | 260 | ||
261 | static char *misc_devnode(struct device *dev, mode_t *mode) | 261 | static char *misc_devnode(struct device *dev, umode_t *mode) |
262 | { | 262 | { |
263 | struct miscdevice *c = dev_get_drvdata(dev); | 263 | struct miscdevice *c = dev_get_drvdata(dev); |
264 | 264 | ||
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index b6de2c047145..54a3a6d09819 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -308,7 +308,7 @@ static const struct file_operations raw_ctl_fops = { | |||
308 | 308 | ||
309 | static struct cdev raw_cdev; | 309 | static struct cdev raw_cdev; |
310 | 310 | ||
311 | static char *raw_devnode(struct device *dev, mode_t *mode) | 311 | static char *raw_devnode(struct device *dev, umode_t *mode) |
312 | { | 312 | { |
313 | return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev)); | 313 | return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev)); |
314 | } | 314 | } |
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c index cf3ee008dca2..4dc019408fac 100644 --- a/drivers/char/tile-srom.c +++ b/drivers/char/tile-srom.c | |||
@@ -329,7 +329,7 @@ static struct device_attribute srom_dev_attrs[] = { | |||
329 | __ATTR_NULL | 329 | __ATTR_NULL |
330 | }; | 330 | }; |
331 | 331 | ||
332 | static char *srom_devnode(struct device *dev, mode_t *mode) | 332 | static char *srom_devnode(struct device *dev, umode_t *mode) |
333 | { | 333 | { |
334 | *mode = S_IRUGO | S_IWUSR; | 334 | *mode = S_IRUGO | S_IWUSR; |
335 | return kasprintf(GFP_KERNEL, "srom/%s", dev_name(dev)); | 335 | return kasprintf(GFP_KERNEL, "srom/%s", dev_name(dev)); |
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 0f9ef9bf6730..62c3675045ac 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
@@ -72,7 +72,7 @@ static int drm_class_resume(struct device *dev) | |||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
74 | 74 | ||
75 | static char *drm_devnode(struct device *dev, mode_t *mode) | 75 | static char *drm_devnode(struct device *dev, umode_t *mode) |
76 | { | 76 | { |
77 | return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); | 77 | return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); |
78 | } | 78 | } |
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 4ef02b269a71..7c297d305d5d 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -859,7 +859,7 @@ static const struct file_operations hiddev_fops = { | |||
859 | .llseek = noop_llseek, | 859 | .llseek = noop_llseek, |
860 | }; | 860 | }; |
861 | 861 | ||
862 | static char *hiddev_devnode(struct device *dev, mode_t *mode) | 862 | static char *hiddev_devnode(struct device *dev, umode_t *mode) |
863 | { | 863 | { |
864 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | 864 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); |
865 | } | 865 | } |
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 8b72f39202fb..c889aaef3416 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c | |||
@@ -3659,7 +3659,7 @@ static struct kobj_type cm_port_obj_type = { | |||
3659 | .release = cm_release_port_obj | 3659 | .release = cm_release_port_obj |
3660 | }; | 3660 | }; |
3661 | 3661 | ||
3662 | static char *cm_devnode(struct device *dev, mode_t *mode) | 3662 | static char *cm_devnode(struct device *dev, umode_t *mode) |
3663 | { | 3663 | { |
3664 | if (mode) | 3664 | if (mode) |
3665 | *mode = 0666; | 3665 | *mode = 0666; |
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c index 07db22997e97..f0d588f8859e 100644 --- a/drivers/infiniband/core/user_mad.c +++ b/drivers/infiniband/core/user_mad.c | |||
@@ -1175,7 +1175,7 @@ static void ib_umad_remove_one(struct ib_device *device) | |||
1175 | kref_put(&umad_dev->ref, ib_umad_release_dev); | 1175 | kref_put(&umad_dev->ref, ib_umad_release_dev); |
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | static char *umad_devnode(struct device *dev, mode_t *mode) | 1178 | static char *umad_devnode(struct device *dev, umode_t *mode) |
1179 | { | 1179 | { |
1180 | return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); | 1180 | return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); |
1181 | } | 1181 | } |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 879636746373..604556d73d25 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -846,7 +846,7 @@ static void ib_uverbs_remove_one(struct ib_device *device) | |||
846 | kfree(uverbs_dev); | 846 | kfree(uverbs_dev); |
847 | } | 847 | } |
848 | 848 | ||
849 | static char *uverbs_devnode(struct device *dev, mode_t *mode) | 849 | static char *uverbs_devnode(struct device *dev, umode_t *mode) |
850 | { | 850 | { |
851 | if (mode) | 851 | if (mode) |
852 | *mode = 0666; | 852 | *mode = 0666; |
diff --git a/drivers/input/input.c b/drivers/input/input.c index da38d97a51b1..1f78c957a75a 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -1624,7 +1624,7 @@ static struct device_type input_dev_type = { | |||
1624 | #endif | 1624 | #endif |
1625 | }; | 1625 | }; |
1626 | 1626 | ||
1627 | static char *input_devnode(struct device *dev, mode_t *mode) | 1627 | static char *input_devnode(struct device *dev, umode_t *mode) |
1628 | { | 1628 | { |
1629 | return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev)); | 1629 | return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev)); |
1630 | } | 1630 | } |
diff --git a/drivers/media/dvb/ddbridge/ddbridge-core.c b/drivers/media/dvb/ddbridge/ddbridge-core.c index ba9a643b9c6a..d1e91bc80e78 100644 --- a/drivers/media/dvb/ddbridge/ddbridge-core.c +++ b/drivers/media/dvb/ddbridge/ddbridge-core.c | |||
@@ -1480,7 +1480,7 @@ static const struct file_operations ddb_fops = { | |||
1480 | .open = ddb_open, | 1480 | .open = ddb_open, |
1481 | }; | 1481 | }; |
1482 | 1482 | ||
1483 | static char *ddb_devnode(struct device *device, mode_t *mode) | 1483 | static char *ddb_devnode(struct device *device, umode_t *mode) |
1484 | { | 1484 | { |
1485 | struct ddb *dev = dev_get_drvdata(device); | 1485 | struct ddb *dev = dev_get_drvdata(device); |
1486 | 1486 | ||
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index f73287775953..00a67326c193 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -450,7 +450,7 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | 452 | ||
453 | static char *dvb_devnode(struct device *dev, mode_t *mode) | 453 | static char *dvb_devnode(struct device *dev, umode_t *mode) |
454 | { | 454 | { |
455 | struct dvb_device *dvbdev = dev_get_drvdata(dev); | 455 | struct dvb_device *dvbdev = dev_get_drvdata(dev); |
456 | 456 | ||
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 29f900065d8a..f5db8b949bc3 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
@@ -715,7 +715,7 @@ static void ir_close(struct input_dev *idev) | |||
715 | } | 715 | } |
716 | 716 | ||
717 | /* class for /sys/class/rc */ | 717 | /* class for /sys/class/rc */ |
718 | static char *ir_devnode(struct device *dev, mode_t *mode) | 718 | static char *ir_devnode(struct device *dev, umode_t *mode) |
719 | { | 719 | { |
720 | return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); | 720 | return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); |
721 | } | 721 | } |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 05085beb83db..3fdebd306b94 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -3267,7 +3267,7 @@ void __init console_init(void) | |||
3267 | } | 3267 | } |
3268 | } | 3268 | } |
3269 | 3269 | ||
3270 | static char *tty_devnode(struct device *dev, mode_t *mode) | 3270 | static char *tty_devnode(struct device *dev, umode_t *mode) |
3271 | { | 3271 | { |
3272 | if (!mode) | 3272 | if (!mode) |
3273 | return NULL; | 3273 | return NULL; |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index cb3a93243a05..bc5089f76cec 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -1045,7 +1045,7 @@ static const struct file_operations usblp_fops = { | |||
1045 | .llseek = noop_llseek, | 1045 | .llseek = noop_llseek, |
1046 | }; | 1046 | }; |
1047 | 1047 | ||
1048 | static char *usblp_devnode(struct device *dev, mode_t *mode) | 1048 | static char *usblp_devnode(struct device *dev, umode_t *mode) |
1049 | { | 1049 | { |
1050 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | 1050 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); |
1051 | } | 1051 | } |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 99458c843d60..d95760de9e8b 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -66,7 +66,7 @@ static struct usb_class { | |||
66 | struct class *class; | 66 | struct class *class; |
67 | } *usb_class; | 67 | } *usb_class; |
68 | 68 | ||
69 | static char *usb_devnode(struct device *dev, mode_t *mode) | 69 | static char *usb_devnode(struct device *dev, umode_t *mode) |
70 | { | 70 | { |
71 | struct usb_class_driver *drv; | 71 | struct usb_class_driver *drv; |
72 | 72 | ||
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 73cd90012ec5..1382c90d0834 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -326,7 +326,7 @@ static const struct dev_pm_ops usb_device_pm_ops = { | |||
326 | #endif /* CONFIG_PM */ | 326 | #endif /* CONFIG_PM */ |
327 | 327 | ||
328 | 328 | ||
329 | static char *usb_devnode(struct device *dev, mode_t *mode) | 329 | static char *usb_devnode(struct device *dev, umode_t *mode) |
330 | { | 330 | { |
331 | struct usb_device *usb_dev; | 331 | struct usb_device *usb_dev; |
332 | 332 | ||
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 81457904d6ba..5bd4b0526de5 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c | |||
@@ -734,7 +734,7 @@ static const struct file_operations iowarrior_fops = { | |||
734 | .llseek = noop_llseek, | 734 | .llseek = noop_llseek, |
735 | }; | 735 | }; |
736 | 736 | ||
737 | static char *iowarrior_devnode(struct device *dev, mode_t *mode) | 737 | static char *iowarrior_devnode(struct device *dev, umode_t *mode) |
738 | { | 738 | { |
739 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | 739 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); |
740 | } | 740 | } |
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index a989356f693e..94f6566b99f8 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c | |||
@@ -269,7 +269,7 @@ static const struct file_operations tower_fops = { | |||
269 | .llseek = tower_llseek, | 269 | .llseek = tower_llseek, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static char *legousbtower_devnode(struct device *dev, mode_t *mode) | 272 | static char *legousbtower_devnode(struct device *dev, umode_t *mode) |
273 | { | 273 | { |
274 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | 274 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); |
275 | } | 275 | } |