diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-03 14:37:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-03 14:37:15 -0400 |
commit | 542a086ac72fb193cbc1b996963a572269e57743 (patch) | |
tree | b137c08037cca4ffc8a156a891a01113b3b8edce /drivers/input | |
parent | 1d1fdd95df681f0c065d90ffaafa215a0e8825e2 (diff) | |
parent | 1eeeef153c02f5856ec109fa532eb5f31c39f85c (diff) |
Merge tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core patches from Greg KH:
"Here's the big driver core pull request for 3.12-rc1.
Lots of tiny changes here fixing up the way sysfs attributes are
created, to try to make drivers simpler, and fix a whole class race
conditions with creations of device attributes after the device was
announced to userspace.
All the various pieces are acked by the different subsystem
maintainers"
* tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (119 commits)
firmware loader: fix pending_fw_head list corruption
drivers/base/memory.c: introduce help macro to_memory_block
dynamic debug: line queries failing due to uninitialized local variable
sysfs: sysfs_create_groups returns a value.
debugfs: provide debugfs_create_x64() when disabled
rbd: convert bus code to use bus_groups
firmware: dcdbas: use binary attribute groups
sysfs: add sysfs_create/remove_groups for when SYSFS is not enabled
driver core: add #include <linux/sysfs.h> to core files.
HID: convert bus code to use dev_groups
Input: serio: convert bus code to use drv_groups
Input: gameport: convert bus code to use drv_groups
driver core: firmware: use __ATTR_RW()
driver core: core: use DEVICE_ATTR_RO
driver core: bus: use DRIVER_ATTR_WO()
driver core: create write-only attribute macros for devices and drivers
sysfs: create __ATTR_WO()
driver-core: platform: convert bus code to use dev_groups
workqueue: convert bus code to use dev_groups
MEI: convert bus code to use dev_groups
...
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/gameport/gameport.c | 12 | ||||
-rw-r--r-- | drivers/input/serio/serio.c | 21 |
2 files changed, 18 insertions, 15 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index da739d9d1905..922a7fea2ce6 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c | |||
@@ -639,16 +639,18 @@ EXPORT_SYMBOL(gameport_unregister_port); | |||
639 | * Gameport driver operations | 639 | * Gameport driver operations |
640 | */ | 640 | */ |
641 | 641 | ||
642 | static ssize_t gameport_driver_show_description(struct device_driver *drv, char *buf) | 642 | static ssize_t description_show(struct device_driver *drv, char *buf) |
643 | { | 643 | { |
644 | struct gameport_driver *driver = to_gameport_driver(drv); | 644 | struct gameport_driver *driver = to_gameport_driver(drv); |
645 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); | 645 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); |
646 | } | 646 | } |
647 | static DRIVER_ATTR_RO(description); | ||
647 | 648 | ||
648 | static struct driver_attribute gameport_driver_attrs[] = { | 649 | static struct attribute *gameport_driver_attrs[] = { |
649 | __ATTR(description, S_IRUGO, gameport_driver_show_description, NULL), | 650 | &driver_attr_description.attr, |
650 | __ATTR_NULL | 651 | NULL |
651 | }; | 652 | }; |
653 | ATTRIBUTE_GROUPS(gameport_driver); | ||
652 | 654 | ||
653 | static int gameport_driver_probe(struct device *dev) | 655 | static int gameport_driver_probe(struct device *dev) |
654 | { | 656 | { |
@@ -749,7 +751,7 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv) | |||
749 | static struct bus_type gameport_bus = { | 751 | static struct bus_type gameport_bus = { |
750 | .name = "gameport", | 752 | .name = "gameport", |
751 | .dev_attrs = gameport_device_attrs, | 753 | .dev_attrs = gameport_device_attrs, |
752 | .drv_attrs = gameport_driver_attrs, | 754 | .drv_groups = gameport_driver_groups, |
753 | .match = gameport_bus_match, | 755 | .match = gameport_bus_match, |
754 | .probe = gameport_driver_probe, | 756 | .probe = gameport_driver_probe, |
755 | .remove = gameport_driver_remove, | 757 | .remove = gameport_driver_remove, |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 25fc5971f426..2b56855c2c77 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -732,19 +732,20 @@ EXPORT_SYMBOL(serio_unregister_child_port); | |||
732 | * Serio driver operations | 732 | * Serio driver operations |
733 | */ | 733 | */ |
734 | 734 | ||
735 | static ssize_t serio_driver_show_description(struct device_driver *drv, char *buf) | 735 | static ssize_t description_show(struct device_driver *drv, char *buf) |
736 | { | 736 | { |
737 | struct serio_driver *driver = to_serio_driver(drv); | 737 | struct serio_driver *driver = to_serio_driver(drv); |
738 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); | 738 | return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); |
739 | } | 739 | } |
740 | static DRIVER_ATTR_RO(description); | ||
740 | 741 | ||
741 | static ssize_t serio_driver_show_bind_mode(struct device_driver *drv, char *buf) | 742 | static ssize_t bind_mode_show(struct device_driver *drv, char *buf) |
742 | { | 743 | { |
743 | struct serio_driver *serio_drv = to_serio_driver(drv); | 744 | struct serio_driver *serio_drv = to_serio_driver(drv); |
744 | return sprintf(buf, "%s\n", serio_drv->manual_bind ? "manual" : "auto"); | 745 | return sprintf(buf, "%s\n", serio_drv->manual_bind ? "manual" : "auto"); |
745 | } | 746 | } |
746 | 747 | ||
747 | static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char *buf, size_t count) | 748 | static ssize_t bind_mode_store(struct device_driver *drv, const char *buf, size_t count) |
748 | { | 749 | { |
749 | struct serio_driver *serio_drv = to_serio_driver(drv); | 750 | struct serio_driver *serio_drv = to_serio_driver(drv); |
750 | int retval; | 751 | int retval; |
@@ -760,14 +761,14 @@ static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char | |||
760 | 761 | ||
761 | return retval; | 762 | return retval; |
762 | } | 763 | } |
764 | static DRIVER_ATTR_RW(bind_mode); | ||
763 | 765 | ||
764 | 766 | static struct attribute *serio_driver_attrs[] = { | |
765 | static struct driver_attribute serio_driver_attrs[] = { | 767 | &driver_attr_description.attr, |
766 | __ATTR(description, S_IRUGO, serio_driver_show_description, NULL), | 768 | &driver_attr_bind_mode.attr, |
767 | __ATTR(bind_mode, S_IWUSR | S_IRUGO, | 769 | NULL, |
768 | serio_driver_show_bind_mode, serio_driver_set_bind_mode), | ||
769 | __ATTR_NULL | ||
770 | }; | 770 | }; |
771 | ATTRIBUTE_GROUPS(serio_driver); | ||
771 | 772 | ||
772 | static int serio_driver_probe(struct device *dev) | 773 | static int serio_driver_probe(struct device *dev) |
773 | { | 774 | { |
@@ -996,7 +997,7 @@ EXPORT_SYMBOL(serio_interrupt); | |||
996 | static struct bus_type serio_bus = { | 997 | static struct bus_type serio_bus = { |
997 | .name = "serio", | 998 | .name = "serio", |
998 | .dev_attrs = serio_device_attrs, | 999 | .dev_attrs = serio_device_attrs, |
999 | .drv_attrs = serio_driver_attrs, | 1000 | .drv_groups = serio_driver_groups, |
1000 | .match = serio_bus_match, | 1001 | .match = serio_bus_match, |
1001 | .uevent = serio_uevent, | 1002 | .uevent = serio_uevent, |
1002 | .probe = serio_driver_probe, | 1003 | .probe = serio_driver_probe, |