diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-09-05 01:33:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:16:43 -0400 |
commit | 39aba963d937edb20db7d9d93e6dda5d2adfdcdd (patch) | |
tree | 7aa1898634ed6f6ece3e48f4b5464fcbcb4f49a5 | |
parent | 807508c8ff9af6ce8f25c5ca5f3eb06a8e7d3286 (diff) |
driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
This patch removes the old CONFIG_SYSFS_DEPRECATED_V2 config option,
but it keeps the logic around to handle block devices in the old manner
as some people like to run new kernel versions on old (pre 2007/2008)
distros.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/base/bus.c | 22 | ||||
-rw-r--r-- | drivers/base/class.c | 19 | ||||
-rw-r--r-- | drivers/base/core.c | 194 | ||||
-rw-r--r-- | drivers/scsi/hosts.c | 2 | ||||
-rw-r--r-- | drivers/scsi/scsi_scan.c | 2 | ||||
-rw-r--r-- | include/sound/core.h | 6 | ||||
-rw-r--r-- | init/Kconfig | 46 | ||||
-rw-r--r-- | sound/core/init.c | 11 |
8 files changed, 43 insertions, 259 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index eb1b7fa20dce..33c270a64db7 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -440,22 +440,6 @@ static void device_remove_attrs(struct bus_type *bus, struct device *dev) | |||
440 | } | 440 | } |
441 | } | 441 | } |
442 | 442 | ||
443 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
444 | static int make_deprecated_bus_links(struct device *dev) | ||
445 | { | ||
446 | return sysfs_create_link(&dev->kobj, | ||
447 | &dev->bus->p->subsys.kobj, "bus"); | ||
448 | } | ||
449 | |||
450 | static void remove_deprecated_bus_links(struct device *dev) | ||
451 | { | ||
452 | sysfs_remove_link(&dev->kobj, "bus"); | ||
453 | } | ||
454 | #else | ||
455 | static inline int make_deprecated_bus_links(struct device *dev) { return 0; } | ||
456 | static inline void remove_deprecated_bus_links(struct device *dev) { } | ||
457 | #endif | ||
458 | |||
459 | /** | 443 | /** |
460 | * bus_add_device - add device to bus | 444 | * bus_add_device - add device to bus |
461 | * @dev: device being added | 445 | * @dev: device being added |
@@ -482,15 +466,10 @@ int bus_add_device(struct device *dev) | |||
482 | &dev->bus->p->subsys.kobj, "subsystem"); | 466 | &dev->bus->p->subsys.kobj, "subsystem"); |
483 | if (error) | 467 | if (error) |
484 | goto out_subsys; | 468 | goto out_subsys; |
485 | error = make_deprecated_bus_links(dev); | ||
486 | if (error) | ||
487 | goto out_deprecated; | ||
488 | klist_add_tail(&dev->p->knode_bus, &bus->p->klist_devices); | 469 | klist_add_tail(&dev->p->knode_bus, &bus->p->klist_devices); |
489 | } | 470 | } |
490 | return 0; | 471 | return 0; |
491 | 472 | ||
492 | out_deprecated: | ||
493 | sysfs_remove_link(&dev->kobj, "subsystem"); | ||
494 | out_subsys: | 473 | out_subsys: |
495 | sysfs_remove_link(&bus->p->devices_kset->kobj, dev_name(dev)); | 474 | sysfs_remove_link(&bus->p->devices_kset->kobj, dev_name(dev)); |
496 | out_id: | 475 | out_id: |
@@ -530,7 +509,6 @@ void bus_remove_device(struct device *dev) | |||
530 | { | 509 | { |
531 | if (dev->bus) { | 510 | if (dev->bus) { |
532 | sysfs_remove_link(&dev->kobj, "subsystem"); | 511 | sysfs_remove_link(&dev->kobj, "subsystem"); |
533 | remove_deprecated_bus_links(dev); | ||
534 | sysfs_remove_link(&dev->bus->p->devices_kset->kobj, | 512 | sysfs_remove_link(&dev->bus->p->devices_kset->kobj, |
535 | dev_name(dev)); | 513 | dev_name(dev)); |
536 | device_remove_attrs(dev->bus, dev); | 514 | device_remove_attrs(dev->bus, dev); |
diff --git a/drivers/base/class.c b/drivers/base/class.c index 8e231d05b400..1078969889fd 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -276,25 +276,6 @@ void class_destroy(struct class *cls) | |||
276 | class_unregister(cls); | 276 | class_unregister(cls); |
277 | } | 277 | } |
278 | 278 | ||
279 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
280 | char *make_class_name(const char *name, struct kobject *kobj) | ||
281 | { | ||
282 | char *class_name; | ||
283 | int size; | ||
284 | |||
285 | size = strlen(name) + strlen(kobject_name(kobj)) + 2; | ||
286 | |||
287 | class_name = kmalloc(size, GFP_KERNEL); | ||
288 | if (!class_name) | ||
289 | return NULL; | ||
290 | |||
291 | strcpy(class_name, name); | ||
292 | strcat(class_name, ":"); | ||
293 | strcat(class_name, kobject_name(kobj)); | ||
294 | return class_name; | ||
295 | } | ||
296 | #endif | ||
297 | |||
298 | /** | 279 | /** |
299 | * class_dev_iter_init - initialize class device iterator | 280 | * class_dev_iter_init - initialize class device iterator |
300 | * @iter: class iterator to initialize | 281 | * @iter: class iterator to initialize |
diff --git a/drivers/base/core.c b/drivers/base/core.c index d1b2c9adc271..6cf9069f3150 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -203,37 +203,6 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, | |||
203 | if (dev->driver) | 203 | if (dev->driver) |
204 | add_uevent_var(env, "DRIVER=%s", dev->driver->name); | 204 | add_uevent_var(env, "DRIVER=%s", dev->driver->name); |
205 | 205 | ||
206 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
207 | if (dev->class) { | ||
208 | struct device *parent = dev->parent; | ||
209 | |||
210 | /* find first bus device in parent chain */ | ||
211 | while (parent && !parent->bus) | ||
212 | parent = parent->parent; | ||
213 | if (parent && parent->bus) { | ||
214 | const char *path; | ||
215 | |||
216 | path = kobject_get_path(&parent->kobj, GFP_KERNEL); | ||
217 | if (path) { | ||
218 | add_uevent_var(env, "PHYSDEVPATH=%s", path); | ||
219 | kfree(path); | ||
220 | } | ||
221 | |||
222 | add_uevent_var(env, "PHYSDEVBUS=%s", parent->bus->name); | ||
223 | |||
224 | if (parent->driver) | ||
225 | add_uevent_var(env, "PHYSDEVDRIVER=%s", | ||
226 | parent->driver->name); | ||
227 | } | ||
228 | } else if (dev->bus) { | ||
229 | add_uevent_var(env, "PHYSDEVBUS=%s", dev->bus->name); | ||
230 | |||
231 | if (dev->driver) | ||
232 | add_uevent_var(env, "PHYSDEVDRIVER=%s", | ||
233 | dev->driver->name); | ||
234 | } | ||
235 | #endif | ||
236 | |||
237 | /* have the bus specific function add its stuff */ | 206 | /* have the bus specific function add its stuff */ |
238 | if (dev->bus && dev->bus->uevent) { | 207 | if (dev->bus && dev->bus->uevent) { |
239 | retval = dev->bus->uevent(dev, env); | 208 | retval = dev->bus->uevent(dev, env); |
@@ -578,24 +547,6 @@ void device_initialize(struct device *dev) | |||
578 | set_dev_node(dev, -1); | 547 | set_dev_node(dev, -1); |
579 | } | 548 | } |
580 | 549 | ||
581 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
582 | static struct kobject *get_device_parent(struct device *dev, | ||
583 | struct device *parent) | ||
584 | { | ||
585 | /* class devices without a parent live in /sys/class/<classname>/ */ | ||
586 | if (dev->class && (!parent || parent->class != dev->class)) | ||
587 | return &dev->class->p->class_subsys.kobj; | ||
588 | /* all other devices keep their parent */ | ||
589 | else if (parent) | ||
590 | return &parent->kobj; | ||
591 | |||
592 | return NULL; | ||
593 | } | ||
594 | |||
595 | static inline void cleanup_device_parent(struct device *dev) {} | ||
596 | static inline void cleanup_glue_dir(struct device *dev, | ||
597 | struct kobject *glue_dir) {} | ||
598 | #else | ||
599 | static struct kobject *virtual_device_parent(struct device *dev) | 550 | static struct kobject *virtual_device_parent(struct device *dev) |
600 | { | 551 | { |
601 | static struct kobject *virtual_dir = NULL; | 552 | static struct kobject *virtual_dir = NULL; |
@@ -666,6 +617,14 @@ static struct kobject *get_device_parent(struct device *dev, | |||
666 | struct kobject *parent_kobj; | 617 | struct kobject *parent_kobj; |
667 | struct kobject *k; | 618 | struct kobject *k; |
668 | 619 | ||
620 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
621 | /* block disks show up in /sys/block */ | ||
622 | if (dev->class == &block_class) { | ||
623 | if (parent && parent->class == &block_class) | ||
624 | return &parent->kobj; | ||
625 | return &block_class.p->class_subsys.kobj; | ||
626 | } | ||
627 | #endif | ||
669 | /* | 628 | /* |
670 | * If we have no parent, we live in "virtual". | 629 | * If we have no parent, we live in "virtual". |
671 | * Class-devices with a non class-device as parent, live | 630 | * Class-devices with a non class-device as parent, live |
@@ -719,7 +678,6 @@ static void cleanup_device_parent(struct device *dev) | |||
719 | { | 678 | { |
720 | cleanup_glue_dir(dev, dev->kobj.parent); | 679 | cleanup_glue_dir(dev, dev->kobj.parent); |
721 | } | 680 | } |
722 | #endif | ||
723 | 681 | ||
724 | static void setup_parent(struct device *dev, struct device *parent) | 682 | static void setup_parent(struct device *dev, struct device *parent) |
725 | { | 683 | { |
@@ -742,70 +700,29 @@ static int device_add_class_symlinks(struct device *dev) | |||
742 | if (error) | 700 | if (error) |
743 | goto out; | 701 | goto out; |
744 | 702 | ||
745 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
746 | /* stacked class devices need a symlink in the class directory */ | ||
747 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && | ||
748 | device_is_not_partition(dev)) { | ||
749 | error = sysfs_create_link(&dev->class->p->class_subsys.kobj, | ||
750 | &dev->kobj, dev_name(dev)); | ||
751 | if (error) | ||
752 | goto out_subsys; | ||
753 | } | ||
754 | |||
755 | if (dev->parent && device_is_not_partition(dev)) { | 703 | if (dev->parent && device_is_not_partition(dev)) { |
756 | struct device *parent = dev->parent; | 704 | error = sysfs_create_link(&dev->kobj, &dev->parent->kobj, |
757 | char *class_name; | ||
758 | |||
759 | /* | ||
760 | * stacked class devices have the 'device' link | ||
761 | * pointing to the bus device instead of the parent | ||
762 | */ | ||
763 | while (parent->class && !parent->bus && parent->parent) | ||
764 | parent = parent->parent; | ||
765 | |||
766 | error = sysfs_create_link(&dev->kobj, | ||
767 | &parent->kobj, | ||
768 | "device"); | 705 | "device"); |
769 | if (error) | 706 | if (error) |
770 | goto out_busid; | 707 | goto out_subsys; |
771 | |||
772 | class_name = make_class_name(dev->class->name, | ||
773 | &dev->kobj); | ||
774 | if (class_name) | ||
775 | error = sysfs_create_link(&dev->parent->kobj, | ||
776 | &dev->kobj, class_name); | ||
777 | kfree(class_name); | ||
778 | if (error) | ||
779 | goto out_device; | ||
780 | } | 708 | } |
781 | return 0; | ||
782 | 709 | ||
783 | out_device: | 710 | #ifdef CONFIG_SYSFS_DEPRECATED |
784 | if (dev->parent && device_is_not_partition(dev)) | 711 | /* /sys/block has directories and does not need symlinks */ |
785 | sysfs_remove_link(&dev->kobj, "device"); | 712 | if (dev->class == &block_class) |
786 | out_busid: | 713 | return 0; |
787 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && | 714 | #endif |
788 | device_is_not_partition(dev)) | 715 | |
789 | sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, | ||
790 | dev_name(dev)); | ||
791 | #else | ||
792 | /* link in the class directory pointing to the device */ | 716 | /* link in the class directory pointing to the device */ |
793 | error = sysfs_create_link(&dev->class->p->class_subsys.kobj, | 717 | error = sysfs_create_link(&dev->class->p->class_subsys.kobj, |
794 | &dev->kobj, dev_name(dev)); | 718 | &dev->kobj, dev_name(dev)); |
795 | if (error) | 719 | if (error) |
796 | goto out_subsys; | 720 | goto out_device; |
797 | 721 | ||
798 | if (dev->parent && device_is_not_partition(dev)) { | ||
799 | error = sysfs_create_link(&dev->kobj, &dev->parent->kobj, | ||
800 | "device"); | ||
801 | if (error) | ||
802 | goto out_busid; | ||
803 | } | ||
804 | return 0; | 722 | return 0; |
805 | 723 | ||
806 | out_busid: | 724 | out_device: |
807 | sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev)); | 725 | sysfs_remove_link(&dev->kobj, "device"); |
808 | #endif | ||
809 | 726 | ||
810 | out_subsys: | 727 | out_subsys: |
811 | sysfs_remove_link(&dev->kobj, "subsystem"); | 728 | sysfs_remove_link(&dev->kobj, "subsystem"); |
@@ -818,30 +735,14 @@ static void device_remove_class_symlinks(struct device *dev) | |||
818 | if (!dev->class) | 735 | if (!dev->class) |
819 | return; | 736 | return; |
820 | 737 | ||
821 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
822 | if (dev->parent && device_is_not_partition(dev)) { | ||
823 | char *class_name; | ||
824 | |||
825 | class_name = make_class_name(dev->class->name, &dev->kobj); | ||
826 | if (class_name) { | ||
827 | sysfs_remove_link(&dev->parent->kobj, class_name); | ||
828 | kfree(class_name); | ||
829 | } | ||
830 | sysfs_remove_link(&dev->kobj, "device"); | ||
831 | } | ||
832 | |||
833 | if (dev->kobj.parent != &dev->class->p->class_subsys.kobj && | ||
834 | device_is_not_partition(dev)) | ||
835 | sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, | ||
836 | dev_name(dev)); | ||
837 | #else | ||
838 | if (dev->parent && device_is_not_partition(dev)) | 738 | if (dev->parent && device_is_not_partition(dev)) |
839 | sysfs_remove_link(&dev->kobj, "device"); | 739 | sysfs_remove_link(&dev->kobj, "device"); |
840 | |||
841 | sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev)); | ||
842 | #endif | ||
843 | |||
844 | sysfs_remove_link(&dev->kobj, "subsystem"); | 740 | sysfs_remove_link(&dev->kobj, "subsystem"); |
741 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
742 | if (dev->class == &block_class) | ||
743 | return; | ||
744 | #endif | ||
745 | sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev)); | ||
845 | } | 746 | } |
846 | 747 | ||
847 | /** | 748 | /** |
@@ -1613,41 +1514,23 @@ int device_rename(struct device *dev, const char *new_name) | |||
1613 | pr_debug("device: '%s': %s: renaming to '%s'\n", dev_name(dev), | 1514 | pr_debug("device: '%s': %s: renaming to '%s'\n", dev_name(dev), |
1614 | __func__, new_name); | 1515 | __func__, new_name); |
1615 | 1516 | ||
1616 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
1617 | if ((dev->class) && (dev->parent)) | ||
1618 | old_class_name = make_class_name(dev->class->name, &dev->kobj); | ||
1619 | #endif | ||
1620 | |||
1621 | old_device_name = kstrdup(dev_name(dev), GFP_KERNEL); | 1517 | old_device_name = kstrdup(dev_name(dev), GFP_KERNEL); |
1622 | if (!old_device_name) { | 1518 | if (!old_device_name) { |
1623 | error = -ENOMEM; | 1519 | error = -ENOMEM; |
1624 | goto out; | 1520 | goto out; |
1625 | } | 1521 | } |
1626 | 1522 | ||
1627 | #ifndef CONFIG_SYSFS_DEPRECATED | ||
1628 | if (dev->class) { | 1523 | if (dev->class) { |
1629 | error = sysfs_rename_link(&dev->class->p->class_subsys.kobj, | 1524 | error = sysfs_rename_link(&dev->class->p->class_subsys.kobj, |
1630 | &dev->kobj, old_device_name, new_name); | 1525 | &dev->kobj, old_device_name, new_name); |
1631 | if (error) | 1526 | if (error) |
1632 | goto out; | 1527 | goto out; |
1633 | } | 1528 | } |
1634 | #endif | 1529 | |
1635 | error = kobject_rename(&dev->kobj, new_name); | 1530 | error = kobject_rename(&dev->kobj, new_name); |
1636 | if (error) | 1531 | if (error) |
1637 | goto out; | 1532 | goto out; |
1638 | 1533 | ||
1639 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
1640 | if (old_class_name) { | ||
1641 | new_class_name = make_class_name(dev->class->name, &dev->kobj); | ||
1642 | if (new_class_name) { | ||
1643 | error = sysfs_rename_link(&dev->parent->kobj, | ||
1644 | &dev->kobj, | ||
1645 | old_class_name, | ||
1646 | new_class_name); | ||
1647 | } | ||
1648 | } | ||
1649 | #endif | ||
1650 | |||
1651 | out: | 1534 | out: |
1652 | put_device(dev); | 1535 | put_device(dev); |
1653 | 1536 | ||
@@ -1664,40 +1547,13 @@ static int device_move_class_links(struct device *dev, | |||
1664 | struct device *new_parent) | 1547 | struct device *new_parent) |
1665 | { | 1548 | { |
1666 | int error = 0; | 1549 | int error = 0; |
1667 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
1668 | char *class_name; | ||
1669 | 1550 | ||
1670 | class_name = make_class_name(dev->class->name, &dev->kobj); | ||
1671 | if (!class_name) { | ||
1672 | error = -ENOMEM; | ||
1673 | goto out; | ||
1674 | } | ||
1675 | if (old_parent) { | ||
1676 | sysfs_remove_link(&dev->kobj, "device"); | ||
1677 | sysfs_remove_link(&old_parent->kobj, class_name); | ||
1678 | } | ||
1679 | if (new_parent) { | ||
1680 | error = sysfs_create_link(&dev->kobj, &new_parent->kobj, | ||
1681 | "device"); | ||
1682 | if (error) | ||
1683 | goto out; | ||
1684 | error = sysfs_create_link(&new_parent->kobj, &dev->kobj, | ||
1685 | class_name); | ||
1686 | if (error) | ||
1687 | sysfs_remove_link(&dev->kobj, "device"); | ||
1688 | } else | ||
1689 | error = 0; | ||
1690 | out: | ||
1691 | kfree(class_name); | ||
1692 | return error; | ||
1693 | #else | ||
1694 | if (old_parent) | 1551 | if (old_parent) |
1695 | sysfs_remove_link(&dev->kobj, "device"); | 1552 | sysfs_remove_link(&dev->kobj, "device"); |
1696 | if (new_parent) | 1553 | if (new_parent) |
1697 | error = sysfs_create_link(&dev->kobj, &new_parent->kobj, | 1554 | error = sysfs_create_link(&dev->kobj, &new_parent->kobj, |
1698 | "device"); | 1555 | "device"); |
1699 | return error; | 1556 | return error; |
1700 | #endif | ||
1701 | } | 1557 | } |
1702 | 1558 | ||
1703 | /** | 1559 | /** |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 8a8f803439e1..ba7f87acc00d 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -411,9 +411,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
411 | 411 | ||
412 | device_initialize(&shost->shost_gendev); | 412 | device_initialize(&shost->shost_gendev); |
413 | dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); | 413 | dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); |
414 | #ifndef CONFIG_SYSFS_DEPRECATED | ||
415 | shost->shost_gendev.bus = &scsi_bus_type; | 414 | shost->shost_gendev.bus = &scsi_bus_type; |
416 | #endif | ||
417 | shost->shost_gendev.type = &scsi_host_type; | 415 | shost->shost_gendev.type = &scsi_host_type; |
418 | 416 | ||
419 | device_initialize(&shost->shost_dev); | 417 | device_initialize(&shost->shost_dev); |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 3d0a1e6e9c48..087821fac8fe 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -417,9 +417,7 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
417 | starget->reap_ref = 1; | 417 | starget->reap_ref = 1; |
418 | dev->parent = get_device(parent); | 418 | dev->parent = get_device(parent); |
419 | dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); | 419 | dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); |
420 | #ifndef CONFIG_SYSFS_DEPRECATED | ||
421 | dev->bus = &scsi_bus_type; | 420 | dev->bus = &scsi_bus_type; |
422 | #endif | ||
423 | dev->type = &scsi_target_type; | 421 | dev->type = &scsi_target_type; |
424 | starget->id = id; | 422 | starget->id = id; |
425 | starget->channel = channel; | 423 | starget->channel = channel; |
diff --git a/include/sound/core.h b/include/sound/core.h index 89e0ac17f44a..df26ebbfa9c6 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -133,9 +133,7 @@ struct snd_card { | |||
133 | int free_on_last_close; /* free in context of file_release */ | 133 | int free_on_last_close; /* free in context of file_release */ |
134 | wait_queue_head_t shutdown_sleep; | 134 | wait_queue_head_t shutdown_sleep; |
135 | struct device *dev; /* device assigned to this card */ | 135 | struct device *dev; /* device assigned to this card */ |
136 | #ifndef CONFIG_SYSFS_DEPRECATED | ||
137 | struct device *card_dev; /* cardX object for sysfs */ | 136 | struct device *card_dev; /* cardX object for sysfs */ |
138 | #endif | ||
139 | 137 | ||
140 | #ifdef CONFIG_PM | 138 | #ifdef CONFIG_PM |
141 | unsigned int power_state; /* power state */ | 139 | unsigned int power_state; /* power state */ |
@@ -196,11 +194,7 @@ struct snd_minor { | |||
196 | /* return a device pointer linked to each sound device as a parent */ | 194 | /* return a device pointer linked to each sound device as a parent */ |
197 | static inline struct device *snd_card_get_device_link(struct snd_card *card) | 195 | static inline struct device *snd_card_get_device_link(struct snd_card *card) |
198 | { | 196 | { |
199 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
200 | return card ? card->dev : NULL; | ||
201 | #else | ||
202 | return card ? card->card_dev : NULL; | 197 | return card ? card->card_dev : NULL; |
203 | #endif | ||
204 | } | 198 | } |
205 | 199 | ||
206 | /* sound.c */ | 200 | /* sound.c */ |
diff --git a/init/Kconfig b/init/Kconfig index 2de5b1cbadd9..137609f33ebc 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -656,40 +656,24 @@ config MM_OWNER | |||
656 | bool | 656 | bool |
657 | 657 | ||
658 | config SYSFS_DEPRECATED | 658 | config SYSFS_DEPRECATED |
659 | bool | ||
660 | |||
661 | config SYSFS_DEPRECATED_V2 | ||
662 | bool "enable deprecated sysfs features to support old userspace tools" | 659 | bool "enable deprecated sysfs features to support old userspace tools" |
663 | depends on SYSFS | 660 | depends on SYSFS |
664 | default n | 661 | default n |
665 | select SYSFS_DEPRECATED | 662 | help |
666 | help | 663 | This option switches the layout of the "block" class devices, to not |
667 | This option switches the layout of sysfs to the deprecated | 664 | show up in /sys/class/block/, but only in /sys/block/. |
668 | version. Do not use it on recent distributions. | 665 | |
669 | 666 | This option allows new kernels to run on old distributions and tools, | |
670 | The current sysfs layout features a unified device tree at | 667 | which might get confused by /sys/class/block/. Since 2007/2008 all |
671 | /sys/devices/, which is able to express a hierarchy between | 668 | major distributions and tools handle this just fine. |
672 | class devices. If the deprecated option is set to Y, the | 669 | |
673 | unified device tree is split into a bus device tree at | 670 | Recent distributions and userspace tools after 2009/2010 depend on |
674 | /sys/devices/ and several individual class device trees at | 671 | the existence of /sys/class/block/, and will not work with this |
675 | /sys/class/. The class and bus devices will be connected by | 672 | option enabled. |
676 | "<subsystem>:<name>" and the "device" links. The "block" | 673 | |
677 | class devices, will not show up in /sys/class/block/. Some | 674 | Only if you are using a new kernel on an old distribution, you might |
678 | subsystems will suppress the creation of some devices which | 675 | need to say Y here. Never say Y, if the original kernel, that came |
679 | depend on the unified device tree. | 676 | with your distribution, has not set this option. |
680 | |||
681 | This option is not a pure compatibility option that can | ||
682 | be safely enabled on newer distributions. It will change the | ||
683 | layout of sysfs to the non-extensible deprecated version, | ||
684 | and disable some features, which can not be exported without | ||
685 | confusing older userspace tools. Since 2007/2008 all major | ||
686 | distributions do not enable this option, and ship no tools which | ||
687 | depend on the deprecated layout or this option. | ||
688 | |||
689 | If you are using a new kernel on an older distribution, or use | ||
690 | older userspace tools, you might need to say Y here. Do not say Y, | ||
691 | if the original kernel, that came with your distribution, has | ||
692 | this option set to N. | ||
693 | 677 | ||
694 | config RELAY | 678 | config RELAY |
695 | bool "Kernel->user space relay support (formerly relayfs)" | 679 | bool "Kernel->user space relay support (formerly relayfs)" |
diff --git a/sound/core/init.c b/sound/core/init.c index ec4a50ce5656..f7c3df8b521b 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
@@ -395,12 +395,10 @@ int snd_card_disconnect(struct snd_card *card) | |||
395 | snd_printk(KERN_ERR "not all devices for card %i can be disconnected\n", card->number); | 395 | snd_printk(KERN_ERR "not all devices for card %i can be disconnected\n", card->number); |
396 | 396 | ||
397 | snd_info_card_disconnect(card); | 397 | snd_info_card_disconnect(card); |
398 | #ifndef CONFIG_SYSFS_DEPRECATED | ||
399 | if (card->card_dev) { | 398 | if (card->card_dev) { |
400 | device_unregister(card->card_dev); | 399 | device_unregister(card->card_dev); |
401 | card->card_dev = NULL; | 400 | card->card_dev = NULL; |
402 | } | 401 | } |
403 | #endif | ||
404 | #ifdef CONFIG_PM | 402 | #ifdef CONFIG_PM |
405 | wake_up(&card->power_sleep); | 403 | wake_up(&card->power_sleep); |
406 | #endif | 404 | #endif |
@@ -573,7 +571,6 @@ void snd_card_set_id(struct snd_card *card, const char *nid) | |||
573 | } | 571 | } |
574 | EXPORT_SYMBOL(snd_card_set_id); | 572 | EXPORT_SYMBOL(snd_card_set_id); |
575 | 573 | ||
576 | #ifndef CONFIG_SYSFS_DEPRECATED | ||
577 | static ssize_t | 574 | static ssize_t |
578 | card_id_show_attr(struct device *dev, | 575 | card_id_show_attr(struct device *dev, |
579 | struct device_attribute *attr, char *buf) | 576 | struct device_attribute *attr, char *buf) |
@@ -630,7 +627,6 @@ card_number_show_attr(struct device *dev, | |||
630 | 627 | ||
631 | static struct device_attribute card_number_attrs = | 628 | static struct device_attribute card_number_attrs = |
632 | __ATTR(number, S_IRUGO, card_number_show_attr, NULL); | 629 | __ATTR(number, S_IRUGO, card_number_show_attr, NULL); |
633 | #endif /* CONFIG_SYSFS_DEPRECATED */ | ||
634 | 630 | ||
635 | /** | 631 | /** |
636 | * snd_card_register - register the soundcard | 632 | * snd_card_register - register the soundcard |
@@ -649,7 +645,7 @@ int snd_card_register(struct snd_card *card) | |||
649 | 645 | ||
650 | if (snd_BUG_ON(!card)) | 646 | if (snd_BUG_ON(!card)) |
651 | return -EINVAL; | 647 | return -EINVAL; |
652 | #ifndef CONFIG_SYSFS_DEPRECATED | 648 | |
653 | if (!card->card_dev) { | 649 | if (!card->card_dev) { |
654 | card->card_dev = device_create(sound_class, card->dev, | 650 | card->card_dev = device_create(sound_class, card->dev, |
655 | MKDEV(0, 0), card, | 651 | MKDEV(0, 0), card, |
@@ -657,7 +653,7 @@ int snd_card_register(struct snd_card *card) | |||
657 | if (IS_ERR(card->card_dev)) | 653 | if (IS_ERR(card->card_dev)) |
658 | card->card_dev = NULL; | 654 | card->card_dev = NULL; |
659 | } | 655 | } |
660 | #endif | 656 | |
661 | if ((err = snd_device_register_all(card)) < 0) | 657 | if ((err = snd_device_register_all(card)) < 0) |
662 | return err; | 658 | return err; |
663 | mutex_lock(&snd_card_mutex); | 659 | mutex_lock(&snd_card_mutex); |
@@ -674,7 +670,6 @@ int snd_card_register(struct snd_card *card) | |||
674 | if (snd_mixer_oss_notify_callback) | 670 | if (snd_mixer_oss_notify_callback) |
675 | snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER); | 671 | snd_mixer_oss_notify_callback(card, SND_MIXER_OSS_NOTIFY_REGISTER); |
676 | #endif | 672 | #endif |
677 | #ifndef CONFIG_SYSFS_DEPRECATED | ||
678 | if (card->card_dev) { | 673 | if (card->card_dev) { |
679 | err = device_create_file(card->card_dev, &card_id_attrs); | 674 | err = device_create_file(card->card_dev, &card_id_attrs); |
680 | if (err < 0) | 675 | if (err < 0) |
@@ -683,7 +678,7 @@ int snd_card_register(struct snd_card *card) | |||
683 | if (err < 0) | 678 | if (err < 0) |
684 | return err; | 679 | return err; |
685 | } | 680 | } |
686 | #endif | 681 | |
687 | return 0; | 682 | return 0; |
688 | } | 683 | } |
689 | 684 | ||