Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -7
+10 -7
drivers/input/gameport/gameport.c
··· 422 422 * Gameport port operations 423 423 */ 424 424 425 - static ssize_t gameport_show_description(struct device *dev, struct device_attribute *attr, char *buf) 425 + static ssize_t gameport_description_show(struct device *dev, struct device_attribute *attr, char *buf) 426 426 { 427 427 struct gameport *gameport = to_gameport_port(dev); 428 428 429 429 return sprintf(buf, "%s\n", gameport->name); 430 430 } 431 + static DEVICE_ATTR(description, S_IRUGO, gameport_description_show, NULL); 431 432 432 - static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 433 + static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 433 434 { 434 435 struct gameport *gameport = to_gameport_port(dev); 435 436 struct device_driver *drv; ··· 458 457 459 458 return error ? error : count; 460 459 } 460 + static DEVICE_ATTR_WO(drvctl); 461 461 462 - static struct device_attribute gameport_device_attrs[] = { 463 - __ATTR(description, S_IRUGO, gameport_show_description, NULL), 464 - __ATTR(drvctl, S_IWUSR, NULL, gameport_rebind_driver), 465 - __ATTR_NULL 462 + static struct attribute *gameport_device_attrs[] = { 463 + &dev_attr_description.attr, 464 + &dev_attr_drvctl.attr, 465 + NULL, 466 466 }; 467 + ATTRIBUTE_GROUPS(gameport_device); 467 468 468 469 static void gameport_release_port(struct device *dev) 469 470 { ··· 753 750 754 751 static struct bus_type gameport_bus = { 755 752 .name = "gameport", 756 - .dev_attrs = gameport_device_attrs, 753 + .dev_groups = gameport_device_groups, 757 754 .drv_groups = gameport_driver_groups, 758 755 .match = gameport_bus_match, 759 756 .probe = gameport_driver_probe,