aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-07 21:27:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-19 23:02:44 -0400
commit0cba7de7f6cdcf84c9b75d29041c475aedeb45c9 (patch)
tree4e298d389f79bf59e07487f3e1ff58f0f78f0d3f
parent3778a2129bcce84f684cc0017ed20d2524afd289 (diff)
input: gameport: convert bus code to use dev_groups
The dev_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the gameport bus code to use the correct field. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: <linux-input@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/input/gameport/gameport.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 922a7fea2ce6..24c41ba7d4e0 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -422,14 +422,15 @@ static struct gameport *gameport_get_pending_child(struct gameport *parent)
422 * Gameport port operations 422 * Gameport port operations
423 */ 423 */
424 424
425static ssize_t gameport_show_description(struct device *dev, struct device_attribute *attr, char *buf) 425static ssize_t gameport_description_show(struct device *dev, struct device_attribute *attr, char *buf)
426{ 426{
427 struct gameport *gameport = to_gameport_port(dev); 427 struct gameport *gameport = to_gameport_port(dev);
428 428
429 return sprintf(buf, "%s\n", gameport->name); 429 return sprintf(buf, "%s\n", gameport->name);
430} 430}
431static DEVICE_ATTR(description, S_IRUGO, gameport_description_show, NULL);
431 432
432static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 433static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
433{ 434{
434 struct gameport *gameport = to_gameport_port(dev); 435 struct gameport *gameport = to_gameport_port(dev);
435 struct device_driver *drv; 436 struct device_driver *drv;
@@ -457,12 +458,14 @@ static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribut
457 458
458 return error ? error : count; 459 return error ? error : count;
459} 460}
461static DEVICE_ATTR_WO(drvctl);
460 462
461static struct device_attribute gameport_device_attrs[] = { 463static struct attribute *gameport_device_attrs[] = {
462 __ATTR(description, S_IRUGO, gameport_show_description, NULL), 464 &dev_attr_description.attr,
463 __ATTR(drvctl, S_IWUSR, NULL, gameport_rebind_driver), 465 &dev_attr_drvctl.attr,
464 __ATTR_NULL 466 NULL,
465}; 467};
468ATTRIBUTE_GROUPS(gameport_device);
466 469
467static void gameport_release_port(struct device *dev) 470static void gameport_release_port(struct device *dev)
468{ 471{
@@ -750,7 +753,7 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv)
750 753
751static struct bus_type gameport_bus = { 754static struct bus_type gameport_bus = {
752 .name = "gameport", 755 .name = "gameport",
753 .dev_attrs = gameport_device_attrs, 756 .dev_groups = gameport_device_groups,
754 .drv_groups = gameport_driver_groups, 757 .drv_groups = gameport_driver_groups,
755 .match = gameport_bus_match, 758 .match = gameport_bus_match,
756 .probe = gameport_driver_probe, 759 .probe = gameport_driver_probe,