diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 14:41:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 14:41:30 -0500 |
commit | a7538a7f87826fb5cacc6959f00dfa9fba6f4b15 (patch) | |
tree | a0fef9252200a78634f0fa4eaa714c7a40e802b9 /drivers | |
parent | 92320cec611d4ed44a9bd635727d61f6caa669a7 (diff) | |
parent | dfff0a0671baf4e69fc676bf8150635407548288 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
Revert "Driver core: let request_module() send a /sys/modules/kmod/-uevent"
Driver core: fix error by cleanup up symlinks properly
make kernel/kmod.c:kmod_mk static
power management: fix struct layout and docs
power management: no valid states w/o pm_ops
Driver core: more fallout from class_device changes for pcmcia
sysfs: move struct sysfs_dirent to private header
driver core: refcounting fix
Driver core: remove class_device_rename
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/class.c | 42 | ||||
-rw-r--r-- | drivers/base/core.c | 31 | ||||
-rw-r--r-- | drivers/pcmcia/hd64465_ss.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/m32r_cfc.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/m8xx_pcmcia.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/omap_cf.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_mgr.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/vrc4171_card.c | 2 |
8 files changed, 36 insertions, 49 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index 1417e5cd4c6f..d5968128be2b 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -840,48 +840,6 @@ void class_device_destroy(struct class *cls, dev_t devt) | |||
840 | class_device_unregister(class_dev); | 840 | class_device_unregister(class_dev); |
841 | } | 841 | } |
842 | 842 | ||
843 | int class_device_rename(struct class_device *class_dev, char *new_name) | ||
844 | { | ||
845 | int error = 0; | ||
846 | char *old_class_name = NULL, *new_class_name = NULL; | ||
847 | |||
848 | class_dev = class_device_get(class_dev); | ||
849 | if (!class_dev) | ||
850 | return -EINVAL; | ||
851 | |||
852 | pr_debug("CLASS: renaming '%s' to '%s'\n", class_dev->class_id, | ||
853 | new_name); | ||
854 | |||
855 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
856 | if (class_dev->dev) | ||
857 | old_class_name = make_class_name(class_dev->class->name, | ||
858 | &class_dev->kobj); | ||
859 | #endif | ||
860 | |||
861 | strlcpy(class_dev->class_id, new_name, KOBJ_NAME_LEN); | ||
862 | |||
863 | error = kobject_rename(&class_dev->kobj, new_name); | ||
864 | |||
865 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
866 | if (class_dev->dev) { | ||
867 | new_class_name = make_class_name(class_dev->class->name, | ||
868 | &class_dev->kobj); | ||
869 | if (new_class_name) | ||
870 | sysfs_create_link(&class_dev->dev->kobj, | ||
871 | &class_dev->kobj, new_class_name); | ||
872 | if (old_class_name) | ||
873 | sysfs_remove_link(&class_dev->dev->kobj, | ||
874 | old_class_name); | ||
875 | } | ||
876 | #endif | ||
877 | class_device_put(class_dev); | ||
878 | |||
879 | kfree(old_class_name); | ||
880 | kfree(new_class_name); | ||
881 | |||
882 | return error; | ||
883 | } | ||
884 | |||
885 | struct class_device * class_device_get(struct class_device *class_dev) | 843 | struct class_device * class_device_get(struct class_device *class_dev) |
886 | { | 844 | { |
887 | if (class_dev) | 845 | if (class_dev) |
diff --git a/drivers/base/core.c b/drivers/base/core.c index d04fd33dcd91..cf2a398aaaa1 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -637,12 +637,41 @@ int device_add(struct device *dev) | |||
637 | BUS_NOTIFY_DEL_DEVICE, dev); | 637 | BUS_NOTIFY_DEL_DEVICE, dev); |
638 | device_remove_groups(dev); | 638 | device_remove_groups(dev); |
639 | GroupError: | 639 | GroupError: |
640 | device_remove_attrs(dev); | 640 | device_remove_attrs(dev); |
641 | AttrsError: | 641 | AttrsError: |
642 | if (dev->devt_attr) { | 642 | if (dev->devt_attr) { |
643 | device_remove_file(dev, dev->devt_attr); | 643 | device_remove_file(dev, dev->devt_attr); |
644 | kfree(dev->devt_attr); | 644 | kfree(dev->devt_attr); |
645 | } | 645 | } |
646 | |||
647 | if (dev->class) { | ||
648 | sysfs_remove_link(&dev->kobj, "subsystem"); | ||
649 | /* If this is not a "fake" compatible device, remove the | ||
650 | * symlink from the class to the device. */ | ||
651 | if (dev->kobj.parent != &dev->class->subsys.kset.kobj) | ||
652 | sysfs_remove_link(&dev->class->subsys.kset.kobj, | ||
653 | dev->bus_id); | ||
654 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
655 | if (parent) { | ||
656 | char *class_name = make_class_name(dev->class->name, | ||
657 | &dev->kobj); | ||
658 | if (class_name) | ||
659 | sysfs_remove_link(&dev->parent->kobj, | ||
660 | class_name); | ||
661 | kfree(class_name); | ||
662 | sysfs_remove_link(&dev->kobj, "device"); | ||
663 | } | ||
664 | #endif | ||
665 | |||
666 | down(&dev->class->sem); | ||
667 | /* notify any interfaces that the device is now gone */ | ||
668 | list_for_each_entry(class_intf, &dev->class->interfaces, node) | ||
669 | if (class_intf->remove_dev) | ||
670 | class_intf->remove_dev(dev, class_intf); | ||
671 | /* remove the device from the class list */ | ||
672 | list_del_init(&dev->node); | ||
673 | up(&dev->class->sem); | ||
674 | } | ||
646 | ueventattrError: | 675 | ueventattrError: |
647 | device_remove_file(dev, &dev->uevent_attr); | 676 | device_remove_file(dev, &dev->uevent_attr); |
648 | attrError: | 677 | attrError: |
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c index caca0dc9d30f..f2e810f53c81 100644 --- a/drivers/pcmcia/hd64465_ss.c +++ b/drivers/pcmcia/hd64465_ss.c | |||
@@ -907,7 +907,7 @@ static int __init init_hs(void) | |||
907 | 907 | ||
908 | for (i=0; i<HS_MAX_SOCKETS; i++) { | 908 | for (i=0; i<HS_MAX_SOCKETS; i++) { |
909 | unsigned int ret; | 909 | unsigned int ret; |
910 | hs_sockets[i].socket.dev.dev = &hd64465_device.dev; | 910 | hs_sockets[i].socket.dev.parent = &hd64465_device.dev; |
911 | hs_sockets[i].number = i; | 911 | hs_sockets[i].number = i; |
912 | ret = pcmcia_register_socket(&hs_sockets[i].socket); | 912 | ret = pcmcia_register_socket(&hs_sockets[i].socket); |
913 | if (ret && i) | 913 | if (ret && i) |
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c index e4a94108aab9..91da15b5a81e 100644 --- a/drivers/pcmcia/m32r_cfc.c +++ b/drivers/pcmcia/m32r_cfc.c | |||
@@ -760,7 +760,7 @@ static int __init init_m32r_pcc(void) | |||
760 | /* Set up interrupt handler(s) */ | 760 | /* Set up interrupt handler(s) */ |
761 | 761 | ||
762 | for (i = 0 ; i < pcc_sockets ; i++) { | 762 | for (i = 0 ; i < pcc_sockets ; i++) { |
763 | socket[i].socket.dev.dev = &pcc_device.dev; | 763 | socket[i].socket.dev.parent = &pcc_device.dev; |
764 | socket[i].socket.ops = &pcc_operations; | 764 | socket[i].socket.ops = &pcc_operations; |
765 | socket[i].socket.resource_ops = &pccard_nonstatic_ops; | 765 | socket[i].socket.resource_ops = &pccard_nonstatic_ops; |
766 | socket[i].socket.owner = THIS_MODULE; | 766 | socket[i].socket.owner = THIS_MODULE; |
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index d059c9196172..9721ed7bf502 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c | |||
@@ -1321,7 +1321,7 @@ static int __init m8xx_init(void) | |||
1321 | socket[i].socket.ops = &m8xx_services; | 1321 | socket[i].socket.ops = &m8xx_services; |
1322 | socket[i].socket.resource_ops = &pccard_iodyn_ops; | 1322 | socket[i].socket.resource_ops = &pccard_iodyn_ops; |
1323 | socket[i].socket.cb_dev = NULL; | 1323 | socket[i].socket.cb_dev = NULL; |
1324 | socket[i].socket.dev.dev = &m8xx_device.dev; | 1324 | socket[i].socket.dev.parent = &m8xx_device.dev; |
1325 | } | 1325 | } |
1326 | 1326 | ||
1327 | for (i = 0; i < PCMCIA_SOCKETS_NO; i++) | 1327 | for (i = 0; i < PCMCIA_SOCKETS_NO; i++) |
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 76f7cbc62a8b..d77f75129f8a 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c | |||
@@ -291,7 +291,7 @@ static int __devinit omap_cf_probe(struct device *dev) | |||
291 | omap_cf_present() ? "present" : "(not present)"); | 291 | omap_cf_present() ? "present" : "(not present)"); |
292 | 292 | ||
293 | cf->socket.owner = THIS_MODULE; | 293 | cf->socket.owner = THIS_MODULE; |
294 | cf->socket.dev.dev = dev; | 294 | cf->socket.dev.parent = dev; |
295 | cf->socket.ops = &omap_cf_ops; | 295 | cf->socket.ops = &omap_cf_ops; |
296 | cf->socket.resource_ops = &pccard_static_ops; | 296 | cf->socket.resource_ops = &pccard_static_ops; |
297 | cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP | 297 | cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP |
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c index 81dfc2cac2b4..ce2226273aaa 100644 --- a/drivers/pcmcia/rsrc_mgr.c +++ b/drivers/pcmcia/rsrc_mgr.c | |||
@@ -232,7 +232,7 @@ static struct resource *iodyn_find_io_region(unsigned long base, int num, | |||
232 | unsigned long align, struct pcmcia_socket *s) | 232 | unsigned long align, struct pcmcia_socket *s) |
233 | { | 233 | { |
234 | struct resource *res = make_resource(0, num, IORESOURCE_IO, | 234 | struct resource *res = make_resource(0, num, IORESOURCE_IO, |
235 | s->dev.class_id); | 235 | s->dev.bus_id); |
236 | struct pcmcia_align_data data; | 236 | struct pcmcia_align_data data; |
237 | unsigned long min = base; | 237 | unsigned long min = base; |
238 | int ret; | 238 | int ret; |
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c index 206e26c91807..eee2f1cb213c 100644 --- a/drivers/pcmcia/vrc4171_card.c +++ b/drivers/pcmcia/vrc4171_card.c | |||
@@ -596,7 +596,7 @@ static int __devinit vrc4171_add_sockets(void) | |||
596 | } | 596 | } |
597 | 597 | ||
598 | sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot); | 598 | sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot); |
599 | socket->pcmcia_socket.dev.dev = &vrc4171_card_device.dev; | 599 | socket->pcmcia_socket.dev.parent = &vrc4171_card_device.dev; |
600 | socket->pcmcia_socket.ops = &vrc4171_pccard_operations; | 600 | socket->pcmcia_socket.ops = &vrc4171_pccard_operations; |
601 | socket->pcmcia_socket.owner = THIS_MODULE; | 601 | socket->pcmcia_socket.owner = THIS_MODULE; |
602 | 602 | ||