diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-06 20:03:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-06 21:42:15 -0500 |
commit | 0324e74534241f3f00910ec04ef67de1fe1542f4 (patch) | |
tree | 88f0b2a40a47dc0a22c0ce5e9b75a58470a56204 /drivers/input | |
parent | 1071ec7bc2dabd0a9d12a1ae5570f4fd3ba944ca (diff) | |
parent | 0cae60f91494e34a0c5391f1455f825d5849b05f (diff) |
Merge tag 'driver-core-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core / sysfs patches from Greg KH:
"Here's the big driver core / sysfs update for 3.13-rc1.
There's lots of dev_groups updates for different subsystems, as they
all get slowly migrated over to the safe versions of the attribute
groups (removing userspace races with the creation of the sysfs
files.) Also in here are some kobject updates, devres expansions, and
the first round of Tejun's sysfs reworking to enable it to be used by
other subsystems as a backend for an in-kernel filesystem.
All of these have been in linux-next for a while with no reported
issues"
* tag 'driver-core-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (83 commits)
sysfs: rename sysfs_assoc_lock and explain what it's about
sysfs: use generic_file_llseek() for sysfs_file_operations
sysfs: return correct error code on unimplemented mmap()
mdio_bus: convert bus code to use dev_groups
device: Make dev_WARN/dev_WARN_ONCE print device as well as driver name
sysfs: separate out dup filename warning into a separate function
sysfs: move sysfs_hash_and_remove() to fs/sysfs/dir.c
sysfs: remove unused sysfs_get_dentry() prototype
sysfs: honor bin_attr.attr.ignore_lockdep
sysfs: merge sysfs_elem_bin_attr into sysfs_elem_attr
devres: restore zeroing behavior of devres_alloc()
sysfs: fix sysfs_write_file for bin file
input: gameport: convert bus code to use dev_groups
input: serio: remove bus usage of dev_attrs
input: serio: use DEVICE_ATTR_RO()
i2o: convert bus code to use dev_groups
memstick: convert bus code to use dev_groups
tifm: convert bus code to use dev_groups
virtio: convert bus code to use dev_groups
ipack: convert bus code to use dev_groups
...
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/gameport/gameport.c | 17 | ||||
-rw-r--r-- | drivers/input/serio/serio.c | 70 |
2 files changed, 44 insertions, 43 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 | ||
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 | 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 | } |
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 | 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 | } |
461 | static DEVICE_ATTR_WO(drvctl); | ||
460 | 462 | ||
461 | static struct device_attribute gameport_device_attrs[] = { | 463 | static 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 | }; |
468 | ATTRIBUTE_GROUPS(gameport_device); | ||
466 | 469 | ||
467 | static void gameport_release_port(struct device *dev) | 470 | static 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 | ||
751 | static struct bus_type gameport_bus = { | 754 | static 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, |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 2b56855c2c77..98707fb2cb5d 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -365,7 +365,7 @@ static ssize_t serio_show_description(struct device *dev, struct device_attribut | |||
365 | return sprintf(buf, "%s\n", serio->name); | 365 | return sprintf(buf, "%s\n", serio->name); |
366 | } | 366 | } |
367 | 367 | ||
368 | static ssize_t serio_show_modalias(struct device *dev, struct device_attribute *attr, char *buf) | 368 | static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) |
369 | { | 369 | { |
370 | struct serio *serio = to_serio_port(dev); | 370 | struct serio *serio = to_serio_port(dev); |
371 | 371 | ||
@@ -373,54 +373,31 @@ static ssize_t serio_show_modalias(struct device *dev, struct device_attribute * | |||
373 | serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); | 373 | serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); |
374 | } | 374 | } |
375 | 375 | ||
376 | static ssize_t serio_show_id_type(struct device *dev, struct device_attribute *attr, char *buf) | 376 | static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf) |
377 | { | 377 | { |
378 | struct serio *serio = to_serio_port(dev); | 378 | struct serio *serio = to_serio_port(dev); |
379 | return sprintf(buf, "%02x\n", serio->id.type); | 379 | return sprintf(buf, "%02x\n", serio->id.type); |
380 | } | 380 | } |
381 | 381 | ||
382 | static ssize_t serio_show_id_proto(struct device *dev, struct device_attribute *attr, char *buf) | 382 | static ssize_t proto_show(struct device *dev, struct device_attribute *attr, char *buf) |
383 | { | 383 | { |
384 | struct serio *serio = to_serio_port(dev); | 384 | struct serio *serio = to_serio_port(dev); |
385 | return sprintf(buf, "%02x\n", serio->id.proto); | 385 | return sprintf(buf, "%02x\n", serio->id.proto); |
386 | } | 386 | } |
387 | 387 | ||
388 | static ssize_t serio_show_id_id(struct device *dev, struct device_attribute *attr, char *buf) | 388 | static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) |
389 | { | 389 | { |
390 | struct serio *serio = to_serio_port(dev); | 390 | struct serio *serio = to_serio_port(dev); |
391 | return sprintf(buf, "%02x\n", serio->id.id); | 391 | return sprintf(buf, "%02x\n", serio->id.id); |
392 | } | 392 | } |
393 | 393 | ||
394 | static ssize_t serio_show_id_extra(struct device *dev, struct device_attribute *attr, char *buf) | 394 | static ssize_t extra_show(struct device *dev, struct device_attribute *attr, char *buf) |
395 | { | 395 | { |
396 | struct serio *serio = to_serio_port(dev); | 396 | struct serio *serio = to_serio_port(dev); |
397 | return sprintf(buf, "%02x\n", serio->id.extra); | 397 | return sprintf(buf, "%02x\n", serio->id.extra); |
398 | } | 398 | } |
399 | 399 | ||
400 | static DEVICE_ATTR(type, S_IRUGO, serio_show_id_type, NULL); | 400 | static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
401 | static DEVICE_ATTR(proto, S_IRUGO, serio_show_id_proto, NULL); | ||
402 | static DEVICE_ATTR(id, S_IRUGO, serio_show_id_id, NULL); | ||
403 | static DEVICE_ATTR(extra, S_IRUGO, serio_show_id_extra, NULL); | ||
404 | |||
405 | static struct attribute *serio_device_id_attrs[] = { | ||
406 | &dev_attr_type.attr, | ||
407 | &dev_attr_proto.attr, | ||
408 | &dev_attr_id.attr, | ||
409 | &dev_attr_extra.attr, | ||
410 | NULL | ||
411 | }; | ||
412 | |||
413 | static struct attribute_group serio_id_attr_group = { | ||
414 | .name = "id", | ||
415 | .attrs = serio_device_id_attrs, | ||
416 | }; | ||
417 | |||
418 | static const struct attribute_group *serio_device_attr_groups[] = { | ||
419 | &serio_id_attr_group, | ||
420 | NULL | ||
421 | }; | ||
422 | |||
423 | static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | ||
424 | { | 401 | { |
425 | struct serio *serio = to_serio_port(dev); | 402 | struct serio *serio = to_serio_port(dev); |
426 | struct device_driver *drv; | 403 | struct device_driver *drv; |
@@ -474,14 +451,36 @@ static ssize_t serio_set_bind_mode(struct device *dev, struct device_attribute * | |||
474 | return retval; | 451 | return retval; |
475 | } | 452 | } |
476 | 453 | ||
477 | static struct device_attribute serio_device_attrs[] = { | 454 | static DEVICE_ATTR_RO(type); |
478 | __ATTR(description, S_IRUGO, serio_show_description, NULL), | 455 | static DEVICE_ATTR_RO(proto); |
479 | __ATTR(modalias, S_IRUGO, serio_show_modalias, NULL), | 456 | static DEVICE_ATTR_RO(id); |
480 | __ATTR(drvctl, S_IWUSR, NULL, serio_rebind_driver), | 457 | static DEVICE_ATTR_RO(extra); |
481 | __ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode), | 458 | static DEVICE_ATTR_RO(modalias); |
482 | __ATTR_NULL | 459 | static DEVICE_ATTR_WO(drvctl); |
460 | static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL); | ||
461 | static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode); | ||
462 | |||
463 | static struct attribute *serio_device_id_attrs[] = { | ||
464 | &dev_attr_type.attr, | ||
465 | &dev_attr_proto.attr, | ||
466 | &dev_attr_id.attr, | ||
467 | &dev_attr_extra.attr, | ||
468 | &dev_attr_modalias.attr, | ||
469 | &dev_attr_description.attr, | ||
470 | &dev_attr_drvctl.attr, | ||
471 | &dev_attr_bind_mode.attr, | ||
472 | NULL | ||
483 | }; | 473 | }; |
484 | 474 | ||
475 | static struct attribute_group serio_id_attr_group = { | ||
476 | .name = "id", | ||
477 | .attrs = serio_device_id_attrs, | ||
478 | }; | ||
479 | |||
480 | static const struct attribute_group *serio_device_attr_groups[] = { | ||
481 | &serio_id_attr_group, | ||
482 | NULL | ||
483 | }; | ||
485 | 484 | ||
486 | static void serio_release_port(struct device *dev) | 485 | static void serio_release_port(struct device *dev) |
487 | { | 486 | { |
@@ -996,7 +995,6 @@ EXPORT_SYMBOL(serio_interrupt); | |||
996 | 995 | ||
997 | static struct bus_type serio_bus = { | 996 | static struct bus_type serio_bus = { |
998 | .name = "serio", | 997 | .name = "serio", |
999 | .dev_attrs = serio_device_attrs, | ||
1000 | .drv_groups = serio_driver_groups, | 998 | .drv_groups = serio_driver_groups, |
1001 | .match = serio_bus_match, | 999 | .match = serio_bus_match, |
1002 | .uevent = serio_uevent, | 1000 | .uevent = serio_uevent, |