diff options
36 files changed, 84 insertions, 87 deletions
diff --git a/arch/powerpc/platforms/pseries/power.c b/arch/powerpc/platforms/pseries/power.c index 73e69023d90a..08d7a5007167 100644 --- a/arch/powerpc/platforms/pseries/power.c +++ b/arch/powerpc/platforms/pseries/power.c | |||
@@ -57,7 +57,7 @@ static struct subsys_attribute auto_poweron_attr = { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | #ifndef CONFIG_PM | 59 | #ifndef CONFIG_PM |
60 | decl_subsys(power,NULL,NULL); | 60 | decl_subsys(power, NULL); |
61 | 61 | ||
62 | static struct attribute *g[] = { | 62 | static struct attribute *g[] = { |
63 | &auto_poweron_attr.attr, | 63 | &auto_poweron_attr.attr, |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 5245717295b8..c022ccc04d41 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -490,7 +490,7 @@ static struct super_operations hypfs_s_ops = { | |||
490 | .show_options = hypfs_show_options, | 490 | .show_options = hypfs_show_options, |
491 | }; | 491 | }; |
492 | 492 | ||
493 | static decl_subsys(s390, NULL, NULL); | 493 | static decl_subsys(s390, NULL); |
494 | 494 | ||
495 | static int __init hypfs_init(void) | 495 | static int __init hypfs_init(void) |
496 | { | 496 | { |
@@ -506,7 +506,7 @@ static int __init hypfs_init(void) | |||
506 | goto fail_diag; | 506 | goto fail_diag; |
507 | } | 507 | } |
508 | } | 508 | } |
509 | kobj_set_kset_s(&s390_subsys, hypervisor_subsys); | 509 | s390_subsys.kobj.kset = &hypervisor_subsys; |
510 | rc = subsystem_register(&s390_subsys); | 510 | rc = subsystem_register(&s390_subsys); |
511 | if (rc) | 511 | if (rc) |
512 | goto fail_sysfs; | 512 | goto fail_sysfs; |
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index ce0856d32500..cae793af5423 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -418,7 +418,7 @@ static struct attribute_group ipl_unknown_attr_group = { | |||
418 | .attrs = ipl_unknown_attrs, | 418 | .attrs = ipl_unknown_attrs, |
419 | }; | 419 | }; |
420 | 420 | ||
421 | static decl_subsys(ipl, NULL, NULL); | 421 | static decl_subsys(ipl, NULL); |
422 | 422 | ||
423 | /* | 423 | /* |
424 | * reipl section | 424 | * reipl section |
@@ -590,7 +590,7 @@ static ssize_t reipl_type_store(struct kset *kset, const char *buf, | |||
590 | static struct subsys_attribute reipl_type_attr = | 590 | static struct subsys_attribute reipl_type_attr = |
591 | __ATTR(reipl_type, 0644, reipl_type_show, reipl_type_store); | 591 | __ATTR(reipl_type, 0644, reipl_type_show, reipl_type_store); |
592 | 592 | ||
593 | static decl_subsys(reipl, NULL, NULL); | 593 | static decl_subsys(reipl, NULL); |
594 | 594 | ||
595 | /* | 595 | /* |
596 | * dump section | 596 | * dump section |
@@ -685,13 +685,13 @@ static ssize_t dump_type_store(struct kset *kset, const char *buf, | |||
685 | static struct subsys_attribute dump_type_attr = | 685 | static struct subsys_attribute dump_type_attr = |
686 | __ATTR(dump_type, 0644, dump_type_show, dump_type_store); | 686 | __ATTR(dump_type, 0644, dump_type_show, dump_type_store); |
687 | 687 | ||
688 | static decl_subsys(dump, NULL, NULL); | 688 | static decl_subsys(dump, NULL); |
689 | 689 | ||
690 | /* | 690 | /* |
691 | * Shutdown actions section | 691 | * Shutdown actions section |
692 | */ | 692 | */ |
693 | 693 | ||
694 | static decl_subsys(shutdown_actions, NULL, NULL); | 694 | static decl_subsys(shutdown_actions, NULL); |
695 | 695 | ||
696 | /* on panic */ | 696 | /* on panic */ |
697 | 697 | ||
diff --git a/block/genhd.c b/block/genhd.c index f2ac914160d1..32227b7ecd17 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -584,7 +584,7 @@ static struct kset_uevent_ops block_uevent_ops = { | |||
584 | .uevent = block_uevent, | 584 | .uevent = block_uevent, |
585 | }; | 585 | }; |
586 | 586 | ||
587 | decl_subsys(block, &ktype_block, &block_uevent_ops); | 587 | decl_subsys(block, &block_uevent_ops); |
588 | 588 | ||
589 | /* | 589 | /* |
590 | * aggregate disk stat collector. Uses the same stats that the sysfs | 590 | * aggregate disk stat collector. Uses the same stats that the sysfs |
@@ -721,7 +721,8 @@ struct gendisk *alloc_disk_node(int minors, int node_id) | |||
721 | } | 721 | } |
722 | } | 722 | } |
723 | disk->minors = minors; | 723 | disk->minors = minors; |
724 | kobj_set_kset_s(disk,block_subsys); | 724 | disk->kobj.kset = &block_subsys; |
725 | disk->kobj.ktype = &ktype_block; | ||
725 | kobject_init(&disk->kobj); | 726 | kobject_init(&disk->kobj); |
726 | rand_initialize_disk(disk); | 727 | rand_initialize_disk(disk); |
727 | INIT_WORK(&disk->async_notify, | 728 | INIT_WORK(&disk->async_notify, |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f4487c38d9f2..7c172d9d7acf 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -743,7 +743,7 @@ static int __init acpi_bus_init(void) | |||
743 | return -ENODEV; | 743 | return -ENODEV; |
744 | } | 744 | } |
745 | 745 | ||
746 | decl_subsys(acpi, NULL, NULL); | 746 | decl_subsys(acpi, NULL); |
747 | 747 | ||
748 | static int __init acpi_init(void) | 748 | static int __init acpi_init(void) |
749 | { | 749 | { |
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 9a19b071c573..630956037e18 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -166,7 +166,7 @@ static struct kset_uevent_ops bus_uevent_ops = { | |||
166 | .filter = bus_uevent_filter, | 166 | .filter = bus_uevent_filter, |
167 | }; | 167 | }; |
168 | 168 | ||
169 | static decl_subsys(bus, &bus_ktype, &bus_uevent_ops); | 169 | static decl_subsys(bus, &bus_uevent_ops); |
170 | 170 | ||
171 | 171 | ||
172 | #ifdef CONFIG_HOTPLUG | 172 | #ifdef CONFIG_HOTPLUG |
@@ -639,6 +639,7 @@ int bus_add_driver(struct device_driver *drv) | |||
639 | if (error) | 639 | if (error) |
640 | goto out_put_bus; | 640 | goto out_put_bus; |
641 | drv->kobj.kset = &bus->drivers; | 641 | drv->kobj.kset = &bus->drivers; |
642 | drv->kobj.ktype = &driver_ktype; | ||
642 | error = kobject_register(&drv->kobj); | 643 | error = kobject_register(&drv->kobj); |
643 | if (error) | 644 | if (error) |
644 | goto out_put_bus; | 645 | goto out_put_bus; |
@@ -851,6 +852,7 @@ int bus_register(struct bus_type * bus) | |||
851 | goto out; | 852 | goto out; |
852 | 853 | ||
853 | bus->subsys.kobj.kset = &bus_subsys; | 854 | bus->subsys.kobj.kset = &bus_subsys; |
855 | bus->subsys.kobj.ktype = &bus_ktype; | ||
854 | 856 | ||
855 | retval = subsystem_register(&bus->subsys); | 857 | retval = subsystem_register(&bus->subsys); |
856 | if (retval) | 858 | if (retval) |
@@ -868,7 +870,6 @@ int bus_register(struct bus_type * bus) | |||
868 | 870 | ||
869 | kobject_set_name(&bus->drivers.kobj, "drivers"); | 871 | kobject_set_name(&bus->drivers.kobj, "drivers"); |
870 | bus->drivers.kobj.parent = &bus->subsys.kobj; | 872 | bus->drivers.kobj.parent = &bus->subsys.kobj; |
871 | bus->drivers.ktype = &driver_ktype; | ||
872 | retval = kset_register(&bus->drivers); | 873 | retval = kset_register(&bus->drivers); |
873 | if (retval) | 874 | if (retval) |
874 | goto bus_drivers_fail; | 875 | goto bus_drivers_fail; |
diff --git a/drivers/base/class.c b/drivers/base/class.c index a863bb091e11..8ad98924cddb 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -71,7 +71,7 @@ static struct kobj_type class_ktype = { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | /* Hotplug events for classes go to the class_obj subsys */ | 73 | /* Hotplug events for classes go to the class_obj subsys */ |
74 | static decl_subsys(class, &class_ktype, NULL); | 74 | static decl_subsys(class, NULL); |
75 | 75 | ||
76 | 76 | ||
77 | int class_create_file(struct class * cls, const struct class_attribute * attr) | 77 | int class_create_file(struct class * cls, const struct class_attribute * attr) |
@@ -150,6 +150,7 @@ int class_register(struct class * cls) | |||
150 | return error; | 150 | return error; |
151 | 151 | ||
152 | cls->subsys.kobj.kset = &class_subsys; | 152 | cls->subsys.kobj.kset = &class_subsys; |
153 | cls->subsys.kobj.ktype = &class_ktype; | ||
153 | 154 | ||
154 | error = subsystem_register(&cls->subsys); | 155 | error = subsystem_register(&cls->subsys); |
155 | if (!error) { | 156 | if (!error) { |
@@ -452,7 +453,7 @@ static struct kset_uevent_ops class_uevent_ops = { | |||
452 | .uevent = class_uevent, | 453 | .uevent = class_uevent, |
453 | }; | 454 | }; |
454 | 455 | ||
455 | static decl_subsys(class_obj, &class_device_ktype, &class_uevent_ops); | 456 | static decl_subsys(class_obj, &class_uevent_ops); |
456 | 457 | ||
457 | 458 | ||
458 | static int class_device_add_attrs(struct class_device * cd) | 459 | static int class_device_add_attrs(struct class_device * cd) |
@@ -537,7 +538,8 @@ static struct class_device_attribute class_uevent_attr = | |||
537 | 538 | ||
538 | void class_device_initialize(struct class_device *class_dev) | 539 | void class_device_initialize(struct class_device *class_dev) |
539 | { | 540 | { |
540 | kobj_set_kset_s(class_dev, class_obj_subsys); | 541 | class_dev->kobj.kset = &class_obj_subsys; |
542 | class_dev->kobj.ktype = &class_device_ktype; | ||
541 | kobject_init(&class_dev->kobj); | 543 | kobject_init(&class_dev->kobj); |
542 | INIT_LIST_HEAD(&class_dev->node); | 544 | INIT_LIST_HEAD(&class_dev->node); |
543 | } | 545 | } |
diff --git a/drivers/base/core.c b/drivers/base/core.c index ce6b64c489ad..c8f2ac03d46d 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -405,7 +405,7 @@ static struct device_attribute devt_attr = | |||
405 | * devices_subsys - structure to be registered with kobject core. | 405 | * devices_subsys - structure to be registered with kobject core. |
406 | */ | 406 | */ |
407 | 407 | ||
408 | decl_subsys(devices, &device_ktype, &device_uevent_ops); | 408 | decl_subsys(devices, &device_uevent_ops); |
409 | 409 | ||
410 | 410 | ||
411 | /** | 411 | /** |
@@ -525,7 +525,8 @@ static void klist_children_put(struct klist_node *n) | |||
525 | 525 | ||
526 | void device_initialize(struct device *dev) | 526 | void device_initialize(struct device *dev) |
527 | { | 527 | { |
528 | kobj_set_kset_s(dev, devices_subsys); | 528 | dev->kobj.kset = &devices_subsys; |
529 | dev->kobj.ktype = &device_ktype; | ||
529 | kobject_init(&dev->kobj); | 530 | kobject_init(&dev->kobj); |
530 | klist_init(&dev->klist_children, klist_children_get, | 531 | klist_init(&dev->klist_children, klist_children_get, |
531 | klist_children_put); | 532 | klist_children_put); |
diff --git a/drivers/base/firmware.c b/drivers/base/firmware.c index 90c862932169..336be0450d54 100644 --- a/drivers/base/firmware.c +++ b/drivers/base/firmware.c | |||
@@ -15,11 +15,12 @@ | |||
15 | 15 | ||
16 | #include "base.h" | 16 | #include "base.h" |
17 | 17 | ||
18 | static decl_subsys(firmware, NULL, NULL); | 18 | static decl_subsys(firmware, NULL); |
19 | 19 | ||
20 | int firmware_register(struct kset *s) | 20 | int firmware_register(struct kset *s) |
21 | { | 21 | { |
22 | kobj_set_kset_s(s, firmware_subsys); | 22 | s->kobj.kset = &firmware_subsys; |
23 | s->kobj.ktype = NULL; | ||
23 | return subsystem_register(s); | 24 | return subsystem_register(s); |
24 | } | 25 | } |
25 | 26 | ||
diff --git a/drivers/base/hypervisor.c b/drivers/base/hypervisor.c index 7080b413ddc9..14e75e9ec783 100644 --- a/drivers/base/hypervisor.c +++ b/drivers/base/hypervisor.c | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #include "base.h" | 12 | #include "base.h" |
13 | 13 | ||
14 | decl_subsys(hypervisor, NULL, NULL); | 14 | decl_subsys(hypervisor, NULL); |
15 | EXPORT_SYMBOL_GPL(hypervisor_subsys); | 15 | EXPORT_SYMBOL_GPL(hypervisor_subsys); |
16 | 16 | ||
17 | int __init hypervisor_init(void) | 17 | int __init hypervisor_init(void) |
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index ac7ff6d0c6e5..7cf19fc318da 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
@@ -131,7 +131,7 @@ EXPORT_SYMBOL_GPL(sysdev_class_remove_file); | |||
131 | /* | 131 | /* |
132 | * declare system_subsys | 132 | * declare system_subsys |
133 | */ | 133 | */ |
134 | static decl_subsys(system, &ktype_sysdev_class, NULL); | 134 | static decl_subsys(system, NULL); |
135 | 135 | ||
136 | int sysdev_class_register(struct sysdev_class * cls) | 136 | int sysdev_class_register(struct sysdev_class * cls) |
137 | { | 137 | { |
@@ -139,6 +139,7 @@ int sysdev_class_register(struct sysdev_class * cls) | |||
139 | kobject_name(&cls->kset.kobj)); | 139 | kobject_name(&cls->kset.kobj)); |
140 | INIT_LIST_HEAD(&cls->drivers); | 140 | INIT_LIST_HEAD(&cls->drivers); |
141 | cls->kset.kobj.parent = &system_subsys.kobj; | 141 | cls->kset.kobj.parent = &system_subsys.kobj; |
142 | cls->kset.kobj.ktype = &ktype_sysdev_class; | ||
142 | cls->kset.kobj.kset = &system_subsys; | 143 | cls->kset.kobj.kset = &system_subsys; |
143 | return kset_register(&cls->kset); | 144 | return kset_register(&cls->kset); |
144 | } | 145 | } |
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 3706b2bc0987..905fcd73c26e 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -744,7 +744,6 @@ static struct kobj_type ktype_mc_set_attribs = { | |||
744 | */ | 744 | */ |
745 | static struct kset mc_kset = { | 745 | static struct kset mc_kset = { |
746 | .kobj = {.ktype = &ktype_mc_set_attribs }, | 746 | .kobj = {.ktype = &ktype_mc_set_attribs }, |
747 | .ktype = &ktype_mci, | ||
748 | }; | 747 | }; |
749 | 748 | ||
750 | 749 | ||
@@ -767,6 +766,7 @@ int edac_mc_register_sysfs_main_kobj(struct mem_ctl_info *mci) | |||
767 | 766 | ||
768 | /* this instance become part of the mc_kset */ | 767 | /* this instance become part of the mc_kset */ |
769 | kobj_mci->kset = &mc_kset; | 768 | kobj_mci->kset = &mc_kset; |
769 | kobj_mci->ktype = &ktype_mci; | ||
770 | 770 | ||
771 | /* set the name of the mc<id> object */ | 771 | /* set the name of the mc<id> object */ |
772 | err = kobject_set_name(kobj_mci, "mc%d", mci->mc_idx); | 772 | err = kobject_set_name(kobj_mci, "mc%d", mci->mc_idx); |
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index 6942e065e609..fc567fad3f7c 100644 --- a/drivers/firmware/edd.c +++ b/drivers/firmware/edd.c | |||
@@ -631,7 +631,7 @@ static struct kobj_type edd_ktype = { | |||
631 | .default_attrs = def_attrs, | 631 | .default_attrs = def_attrs, |
632 | }; | 632 | }; |
633 | 633 | ||
634 | static decl_subsys(edd, &edd_ktype, NULL); | 634 | static decl_subsys(edd, NULL); |
635 | 635 | ||
636 | 636 | ||
637 | /** | 637 | /** |
@@ -723,7 +723,8 @@ edd_device_register(struct edd_device *edev, int i) | |||
723 | edd_dev_set_info(edev, i); | 723 | edd_dev_set_info(edev, i); |
724 | kobject_set_name(&edev->kobj, "int13_dev%02x", | 724 | kobject_set_name(&edev->kobj, "int13_dev%02x", |
725 | 0x80 + i); | 725 | 0x80 + i); |
726 | kobj_set_kset_s(edev,edd_subsys); | 726 | edev->kobj.kset = &edd_subsys; |
727 | edev->kobj.ktype = &edd_ktype; | ||
727 | error = kobject_register(&edev->kobj); | 728 | error = kobject_register(&edev->kobj); |
728 | if (!error) | 729 | if (!error) |
729 | edd_populate_dir(edev); | 730 | edd_populate_dir(edev); |
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 858a7b95933b..06ecdb9f6013 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -583,8 +583,8 @@ static struct subsys_attribute *efi_subsys_attrs[] = { | |||
583 | NULL, /* maybe more in the future? */ | 583 | NULL, /* maybe more in the future? */ |
584 | }; | 584 | }; |
585 | 585 | ||
586 | static decl_subsys(vars, &efivar_ktype, NULL); | 586 | static decl_subsys(vars, NULL); |
587 | static decl_subsys(efi, NULL, NULL); | 587 | static decl_subsys(efi, NULL); |
588 | 588 | ||
589 | /* | 589 | /* |
590 | * efivar_create_sysfs_entry() | 590 | * efivar_create_sysfs_entry() |
@@ -629,7 +629,8 @@ efivar_create_sysfs_entry(unsigned long variable_name_size, | |||
629 | efi_guid_unparse(vendor_guid, short_name + strlen(short_name)); | 629 | efi_guid_unparse(vendor_guid, short_name + strlen(short_name)); |
630 | 630 | ||
631 | kobject_set_name(&new_efivar->kobj, "%s", short_name); | 631 | kobject_set_name(&new_efivar->kobj, "%s", short_name); |
632 | kobj_set_kset_s(new_efivar, vars_subsys); | 632 | new_efivar->kobj.kset = &vars_subsys; |
633 | new_efivar->kobj.ktype = &efivar_ktype; | ||
633 | i = kobject_register(&new_efivar->kobj); | 634 | i = kobject_register(&new_efivar->kobj); |
634 | if (i) { | 635 | if (i) { |
635 | kfree(short_name); | 636 | kfree(short_name); |
@@ -687,7 +688,7 @@ efivars_init(void) | |||
687 | goto out_free; | 688 | goto out_free; |
688 | } | 689 | } |
689 | 690 | ||
690 | kobj_set_kset_s(&vars_subsys, efi_subsys); | 691 | vars_subsys.kobj.kset = &efi_subsys; |
691 | 692 | ||
692 | error = subsystem_register(&vars_subsys); | 693 | error = subsystem_register(&vars_subsys); |
693 | 694 | ||
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index ebb09e98d215..1382be64cc3f 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c | |||
@@ -964,8 +964,8 @@ static struct subsys_attribute *pdcs_subsys_attrs[] = { | |||
964 | NULL, | 964 | NULL, |
965 | }; | 965 | }; |
966 | 966 | ||
967 | static decl_subsys(paths, &ktype_pdcspath, NULL); | 967 | static decl_subsys(paths, NULL); |
968 | static decl_subsys(stable, NULL, NULL); | 968 | static decl_subsys(stable, NULL); |
969 | 969 | ||
970 | /** | 970 | /** |
971 | * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage. | 971 | * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage. |
@@ -997,7 +997,8 @@ pdcs_register_pathentries(void) | |||
997 | 997 | ||
998 | if ((err = kobject_set_name(&entry->kobj, "%s", entry->name))) | 998 | if ((err = kobject_set_name(&entry->kobj, "%s", entry->name))) |
999 | return err; | 999 | return err; |
1000 | kobj_set_kset_s(entry, paths_subsys); | 1000 | entry->kobj.kset = &paths_subsys; |
1001 | entry->kobj.ktype = &ktype_pdcspath; | ||
1001 | if ((err = kobject_register(&entry->kobj))) | 1002 | if ((err = kobject_register(&entry->kobj))) |
1002 | return err; | 1003 | return err; |
1003 | 1004 | ||
@@ -1072,7 +1073,7 @@ pdc_stable_init(void) | |||
1072 | error = subsys_create_file(&stable_subsys, attr); | 1073 | error = subsys_create_file(&stable_subsys, attr); |
1073 | 1074 | ||
1074 | /* register the paths subsys as a subsystem of stable subsys */ | 1075 | /* register the paths subsys as a subsystem of stable subsys */ |
1075 | kobj_set_kset_s(&paths_subsys, stable_subsys); | 1076 | paths_subsys.kobj.kset = &stable_subsys; |
1076 | if ((rc = subsystem_register(&paths_subsys))) | 1077 | if ((rc = subsystem_register(&paths_subsys))) |
1077 | goto fail_subsysreg; | 1078 | goto fail_subsysreg; |
1078 | 1079 | ||
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 01c351c176ac..ce1cff0fdeca 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -96,7 +96,7 @@ static struct kobj_type hotplug_slot_ktype = { | |||
96 | .release = &hotplug_slot_release, | 96 | .release = &hotplug_slot_release, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | decl_subsys_name(pci_hotplug_slots, slots, &hotplug_slot_ktype, NULL); | 99 | decl_subsys_name(pci_hotplug_slots, slots, NULL); |
100 | 100 | ||
101 | /* these strings match up with the values in pci_bus_speed */ | 101 | /* these strings match up with the values in pci_bus_speed */ |
102 | static char *pci_bus_speed_strings[] = { | 102 | static char *pci_bus_speed_strings[] = { |
@@ -633,7 +633,8 @@ int pci_hp_register (struct hotplug_slot *slot) | |||
633 | } | 633 | } |
634 | 634 | ||
635 | kobject_set_name(&slot->kobj, "%s", slot->name); | 635 | kobject_set_name(&slot->kobj, "%s", slot->name); |
636 | kobj_set_kset_s(slot, pci_hotplug_slots_subsys); | 636 | slot->kobj.kset = &pci_hotplug_slots_subsys; |
637 | slot->kobj.ktype = &hotplug_slot_ktype; | ||
637 | 638 | ||
638 | /* this can fail if we have already registered a slot with the same name */ | 639 | /* this can fail if we have already registered a slot with the same name */ |
639 | if (kobject_register(&slot->kobj)) { | 640 | if (kobject_register(&slot->kobj)) { |
@@ -701,7 +702,7 @@ static int __init pci_hotplug_init (void) | |||
701 | { | 702 | { |
702 | int result; | 703 | int result; |
703 | 704 | ||
704 | kobj_set_kset_s(&pci_hotplug_slots_subsys, pci_bus_type.subsys); | 705 | pci_hotplug_slots_subsys.kobj.kset = &pci_bus_type.subsys; |
705 | result = subsystem_register(&pci_hotplug_slots_subsys); | 706 | result = subsystem_register(&pci_hotplug_slots_subsys); |
706 | if (result) { | 707 | if (result) { |
707 | err("Register subsys with error %d\n", result); | 708 | err("Register subsys with error %d\n", result); |
diff --git a/drivers/pci/hotplug/rpadlpar_sysfs.c b/drivers/pci/hotplug/rpadlpar_sysfs.c index a080fedf0332..76090937c758 100644 --- a/drivers/pci/hotplug/rpadlpar_sysfs.c +++ b/drivers/pci/hotplug/rpadlpar_sysfs.c | |||
@@ -131,7 +131,6 @@ struct kobj_type ktype_dlpar_io = { | |||
131 | struct kset dlpar_io_kset = { | 131 | struct kset dlpar_io_kset = { |
132 | .kobj = {.ktype = &ktype_dlpar_io, | 132 | .kobj = {.ktype = &ktype_dlpar_io, |
133 | .parent = &pci_hotplug_slots_subsys.kobj}, | 133 | .parent = &pci_hotplug_slots_subsys.kobj}, |
134 | .ktype = &ktype_dlpar_io, | ||
135 | }; | 134 | }; |
136 | 135 | ||
137 | int dlpar_sysfs_init(void) | 136 | int dlpar_sysfs_init(void) |
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 865f32b63b5c..606aae7490ab 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
@@ -160,7 +160,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) | |||
160 | if (!map_found) { | 160 | if (!map_found) { |
161 | map_found = 1; | 161 | map_found = 1; |
162 | kobject_set_name(&idev->map_attr_kset.kobj,"maps"); | 162 | kobject_set_name(&idev->map_attr_kset.kobj,"maps"); |
163 | idev->map_attr_kset.ktype = &map_attr_type; | 163 | idev->map_attr_kset.kobj.ktype = &map_attr_type; |
164 | idev->map_attr_kset.kobj.parent = &idev->dev->kobj; | 164 | idev->map_attr_kset.kobj.parent = &idev->dev->kobj; |
165 | ret = kset_register(&idev->map_attr_kset); | 165 | ret = kset_register(&idev->map_attr_kset); |
166 | if (ret) | 166 | if (ret) |
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index 3bf0278ea843..374ddbd6648d 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c | |||
@@ -128,7 +128,7 @@ void configfs_release_fs(void) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | 130 | ||
131 | static decl_subsys(config, NULL, NULL); | 131 | static decl_subsys(config, NULL); |
132 | 132 | ||
133 | static int __init configfs_init(void) | 133 | static int __init configfs_init(void) |
134 | { | 134 | { |
@@ -140,7 +140,7 @@ static int __init configfs_init(void) | |||
140 | if (!configfs_dir_cachep) | 140 | if (!configfs_dir_cachep) |
141 | goto out; | 141 | goto out; |
142 | 142 | ||
143 | kobj_set_kset_s(&config_subsys, kernel_subsys); | 143 | config_subsys.kobj.kset = &kernel_subsys; |
144 | err = subsystem_register(&config_subsys); | 144 | err = subsystem_register(&config_subsys); |
145 | if (err) { | 145 | if (err) { |
146 | kmem_cache_destroy(configfs_dir_cachep); | 146 | kmem_cache_destroy(configfs_dir_cachep); |
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 6a713b33992f..f7f13516fc1a 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
@@ -426,13 +426,13 @@ exit: | |||
426 | } | 426 | } |
427 | EXPORT_SYMBOL_GPL(debugfs_rename); | 427 | EXPORT_SYMBOL_GPL(debugfs_rename); |
428 | 428 | ||
429 | static decl_subsys(debug, NULL, NULL); | 429 | static decl_subsys(debug, NULL); |
430 | 430 | ||
431 | static int __init debugfs_init(void) | 431 | static int __init debugfs_init(void) |
432 | { | 432 | { |
433 | int retval; | 433 | int retval; |
434 | 434 | ||
435 | kobj_set_kset_s(&debug_subsys, kernel_subsys); | 435 | debug_subsys.kobj.kset = &kernel_subsys; |
436 | retval = subsystem_register(&debug_subsys); | 436 | retval = subsystem_register(&debug_subsys); |
437 | if (retval) | 437 | if (retval) |
438 | return retval; | 438 | return retval; |
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index 6353a8384520..18e4a17b9bee 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c | |||
@@ -166,9 +166,7 @@ static struct kobj_type dlm_ktype = { | |||
166 | .release = lockspace_kobj_release, | 166 | .release = lockspace_kobj_release, |
167 | }; | 167 | }; |
168 | 168 | ||
169 | static struct kset dlm_kset = { | 169 | static struct kset dlm_kset; |
170 | .ktype = &dlm_ktype, | ||
171 | }; | ||
172 | 170 | ||
173 | static int kobject_setup(struct dlm_ls *ls) | 171 | static int kobject_setup(struct dlm_ls *ls) |
174 | { | 172 | { |
@@ -228,7 +226,7 @@ int dlm_lockspace_init(void) | |||
228 | spin_lock_init(&lslist_lock); | 226 | spin_lock_init(&lslist_lock); |
229 | 227 | ||
230 | kobject_set_name(&dlm_kset.kobj, "dlm"); | 228 | kobject_set_name(&dlm_kset.kobj, "dlm"); |
231 | kobj_set_kset_s(&dlm_kset, kernel_subsys); | 229 | dlm_kset.kobj.kset = &kernel_subsys; |
232 | error = kset_register(&dlm_kset); | 230 | error = kset_register(&dlm_kset); |
233 | if (error) | 231 | if (error) |
234 | printk("dlm_lockspace_init: cannot register kset %d\n", error); | 232 | printk("dlm_lockspace_init: cannot register kset %d\n", error); |
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index f9f32472c505..fe2f44fa17cc 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -734,7 +734,7 @@ static int ecryptfs_init_kmem_caches(void) | |||
734 | return 0; | 734 | return 0; |
735 | } | 735 | } |
736 | 736 | ||
737 | static decl_subsys(ecryptfs, NULL, NULL); | 737 | static decl_subsys(ecryptfs, NULL); |
738 | 738 | ||
739 | static ssize_t version_show(struct kset *kset, char *buff) | 739 | static ssize_t version_show(struct kset *kset, char *buff) |
740 | { | 740 | { |
@@ -798,6 +798,7 @@ static int do_sysfs_registration(void) | |||
798 | { | 798 | { |
799 | int rc; | 799 | int rc; |
800 | 800 | ||
801 | ecryptfs_subsys.kobj.kset = &fs_subsys; | ||
801 | rc = subsystem_register(&ecryptfs_subsys); | 802 | rc = subsystem_register(&ecryptfs_subsys); |
802 | if (rc) { | 803 | if (rc) { |
803 | printk(KERN_ERR | 804 | printk(KERN_ERR |
@@ -845,7 +846,6 @@ static int __init ecryptfs_init(void) | |||
845 | printk(KERN_ERR "Failed to register filesystem\n"); | 846 | printk(KERN_ERR "Failed to register filesystem\n"); |
846 | goto out_free_kmem_caches; | 847 | goto out_free_kmem_caches; |
847 | } | 848 | } |
848 | kobj_set_kset_s(&ecryptfs_subsys, fs_subsys); | ||
849 | rc = do_sysfs_registration(); | 849 | rc = do_sysfs_registration(); |
850 | if (rc) { | 850 | if (rc) { |
851 | printk(KERN_ERR "sysfs registration failed\n"); | 851 | printk(KERN_ERR "sysfs registration failed\n"); |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 84f9f7dfdf5b..f5e4182c482e 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -744,8 +744,8 @@ static inline void unregister_fuseblk(void) | |||
744 | } | 744 | } |
745 | #endif | 745 | #endif |
746 | 746 | ||
747 | static decl_subsys(fuse, NULL, NULL); | 747 | static decl_subsys(fuse, NULL); |
748 | static decl_subsys(connections, NULL, NULL); | 748 | static decl_subsys(connections, NULL); |
749 | 749 | ||
750 | static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo) | 750 | static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo) |
751 | { | 751 | { |
@@ -795,12 +795,12 @@ static int fuse_sysfs_init(void) | |||
795 | { | 795 | { |
796 | int err; | 796 | int err; |
797 | 797 | ||
798 | kobj_set_kset_s(&fuse_subsys, fs_subsys); | 798 | fuse_subsys.kobj.kset = &fs_subsys; |
799 | err = subsystem_register(&fuse_subsys); | 799 | err = subsystem_register(&fuse_subsys); |
800 | if (err) | 800 | if (err) |
801 | goto out_err; | 801 | goto out_err; |
802 | 802 | ||
803 | kobj_set_kset_s(&connections_subsys, fuse_subsys); | 803 | connections_subsys.kobj.kset = &fuse_subsys; |
804 | err = subsystem_register(&connections_subsys); | 804 | err = subsystem_register(&connections_subsys); |
805 | if (err) | 805 | if (err) |
806 | goto out_fuse_unregister; | 806 | goto out_fuse_unregister; |
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c index ae9e6a25fe2b..93e66b22757f 100644 --- a/fs/gfs2/locking/dlm/sysfs.c +++ b/fs/gfs2/locking/dlm/sysfs.c | |||
@@ -189,9 +189,7 @@ static struct kobj_type gdlm_ktype = { | |||
189 | .sysfs_ops = &gdlm_attr_ops, | 189 | .sysfs_ops = &gdlm_attr_ops, |
190 | }; | 190 | }; |
191 | 191 | ||
192 | static struct kset gdlm_kset = { | 192 | static struct kset gdlm_kset; |
193 | .ktype = &gdlm_ktype, | ||
194 | }; | ||
195 | 193 | ||
196 | int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj) | 194 | int gdlm_kobject_setup(struct gdlm_ls *ls, struct kobject *fskobj) |
197 | { | 195 | { |
@@ -224,7 +222,7 @@ int gdlm_sysfs_init(void) | |||
224 | int error; | 222 | int error; |
225 | 223 | ||
226 | kobject_set_name(&gdlm_kset.kobj, "lock_dlm"); | 224 | kobject_set_name(&gdlm_kset.kobj, "lock_dlm"); |
227 | kobj_set_kset_s(&gdlm_kset, kernel_subsys); | 225 | gdlm_kset.kobj.kset = &kernel_subsys; |
228 | error = kset_register(&gdlm_kset); | 226 | error = kset_register(&gdlm_kset); |
229 | if (error) | 227 | if (error) |
230 | printk("lock_dlm: cannot register kset %d\n", error); | 228 | printk("lock_dlm: cannot register kset %d\n", error); |
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index 06e0b7768d97..d7fa54443f0c 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
@@ -221,9 +221,7 @@ static struct kobj_type gfs2_ktype = { | |||
221 | .sysfs_ops = &gfs2_attr_ops, | 221 | .sysfs_ops = &gfs2_attr_ops, |
222 | }; | 222 | }; |
223 | 223 | ||
224 | static struct kset gfs2_kset = { | 224 | static struct kset gfs2_kset; |
225 | .ktype = &gfs2_ktype, | ||
226 | }; | ||
227 | 225 | ||
228 | /* | 226 | /* |
229 | * display struct lm_lockstruct fields | 227 | * display struct lm_lockstruct fields |
@@ -551,7 +549,7 @@ int gfs2_sys_init(void) | |||
551 | gfs2_sys_margs = NULL; | 549 | gfs2_sys_margs = NULL; |
552 | spin_lock_init(&gfs2_sys_margs_lock); | 550 | spin_lock_init(&gfs2_sys_margs_lock); |
553 | kobject_set_name(&gfs2_kset.kobj, "gfs2"); | 551 | kobject_set_name(&gfs2_kset.kobj, "gfs2"); |
554 | kobj_set_kset_s(&gfs2_kset, fs_subsys); | 552 | gfs2_kset.kobj.kset = &fs_subsys; |
555 | return kset_register(&gfs2_kset); | 553 | return kset_register(&gfs2_kset); |
556 | } | 554 | } |
557 | 555 | ||
diff --git a/fs/namespace.c b/fs/namespace.c index 06083885b21e..a4a3f70e7e26 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -41,7 +41,7 @@ static struct kmem_cache *mnt_cache __read_mostly; | |||
41 | static struct rw_semaphore namespace_sem; | 41 | static struct rw_semaphore namespace_sem; |
42 | 42 | ||
43 | /* /sys/fs */ | 43 | /* /sys/fs */ |
44 | decl_subsys(fs, NULL, NULL); | 44 | decl_subsys(fs, NULL); |
45 | EXPORT_SYMBOL_GPL(fs_subsys); | 45 | EXPORT_SYMBOL_GPL(fs_subsys); |
46 | 46 | ||
47 | static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry) | 47 | static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry) |
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c index a4882c8df945..dead319932b3 100644 --- a/fs/ocfs2/cluster/masklog.c +++ b/fs/ocfs2/cluster/masklog.c | |||
@@ -157,7 +157,7 @@ int mlog_sys_init(struct kset *o2cb_subsys) | |||
157 | mlog_attr_ptrs[i] = NULL; | 157 | mlog_attr_ptrs[i] = NULL; |
158 | 158 | ||
159 | kobject_set_name(&mlog_kset.kobj, "logmask"); | 159 | kobject_set_name(&mlog_kset.kobj, "logmask"); |
160 | kobj_set_kset_s(&mlog_kset, *o2cb_subsys); | 160 | mlog_kset.kobj.kset = o2cb_subsys; |
161 | return kset_register(&mlog_kset); | 161 | return kset_register(&mlog_kset); |
162 | } | 162 | } |
163 | 163 | ||
diff --git a/fs/ocfs2/cluster/sys.c b/fs/ocfs2/cluster/sys.c index 64f6f378fd09..880d0138bb0a 100644 --- a/fs/ocfs2/cluster/sys.c +++ b/fs/ocfs2/cluster/sys.c | |||
@@ -72,7 +72,7 @@ static struct kobj_type o2cb_subsys_type = { | |||
72 | }; | 72 | }; |
73 | 73 | ||
74 | /* gives us o2cb_subsys */ | 74 | /* gives us o2cb_subsys */ |
75 | static decl_subsys(o2cb, NULL, NULL); | 75 | static decl_subsys(o2cb, NULL); |
76 | 76 | ||
77 | static ssize_t | 77 | static ssize_t |
78 | o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer) | 78 | o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer) |
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 09a0611b3364..387a63662793 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -365,9 +365,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file) | |||
365 | /* if the kobject has no ktype, then we assume that it is a subsystem | 365 | /* if the kobject has no ktype, then we assume that it is a subsystem |
366 | * itself, and use ops for it. | 366 | * itself, and use ops for it. |
367 | */ | 367 | */ |
368 | if (kobj->kset && kobj->kset->ktype) | 368 | if (kobj->ktype) |
369 | ops = kobj->kset->ktype->sysfs_ops; | ||
370 | else if (kobj->ktype) | ||
371 | ops = kobj->ktype->sysfs_ops; | 369 | ops = kobj->ktype->sysfs_ops; |
372 | else | 370 | else |
373 | ops = &subsys_sysfs_ops; | 371 | ops = &subsys_sysfs_ops; |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e2b8c3dae425..5031565ab30d 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -135,7 +135,6 @@ struct kset_uevent_ops { | |||
135 | * define the attribute callbacks and other common events that happen to | 135 | * define the attribute callbacks and other common events that happen to |
136 | * a kobject. | 136 | * a kobject. |
137 | * | 137 | * |
138 | * @ktype: the struct kobj_type for this specific kset | ||
139 | * @list: the list of all kobjects for this kset | 138 | * @list: the list of all kobjects for this kset |
140 | * @list_lock: a lock for iterating over the kobjects | 139 | * @list_lock: a lock for iterating over the kobjects |
141 | * @kobj: the embedded kobject for this kset (recursion, isn't it fun...) | 140 | * @kobj: the embedded kobject for this kset (recursion, isn't it fun...) |
@@ -145,7 +144,6 @@ struct kset_uevent_ops { | |||
145 | * desired. | 144 | * desired. |
146 | */ | 145 | */ |
147 | struct kset { | 146 | struct kset { |
148 | struct kobj_type *ktype; | ||
149 | struct list_head list; | 147 | struct list_head list; |
150 | spinlock_t list_lock; | 148 | spinlock_t list_lock; |
151 | struct kobject kobj; | 149 | struct kobject kobj; |
@@ -173,12 +171,9 @@ static inline void kset_put(struct kset * k) | |||
173 | kobject_put(&k->kobj); | 171 | kobject_put(&k->kobj); |
174 | } | 172 | } |
175 | 173 | ||
176 | static inline struct kobj_type * get_ktype(struct kobject * k) | 174 | static inline struct kobj_type *get_ktype(struct kobject *kobj) |
177 | { | 175 | { |
178 | if (k->kset && k->kset->ktype) | 176 | return kobj->ktype; |
179 | return k->kset->ktype; | ||
180 | else | ||
181 | return k->ktype; | ||
182 | } | 177 | } |
183 | 178 | ||
184 | extern struct kobject * kset_find_obj(struct kset *, const char *); | 179 | extern struct kobject * kset_find_obj(struct kset *, const char *); |
@@ -191,16 +186,14 @@ extern struct kobject * kset_find_obj(struct kset *, const char *); | |||
191 | #define set_kset_name(str) .kset = { .kobj = { .k_name = str } } | 186 | #define set_kset_name(str) .kset = { .kobj = { .k_name = str } } |
192 | 187 | ||
193 | 188 | ||
194 | #define decl_subsys(_name,_type,_uevent_ops) \ | 189 | #define decl_subsys(_name,_uevent_ops) \ |
195 | struct kset _name##_subsys = { \ | 190 | struct kset _name##_subsys = { \ |
196 | .kobj = { .k_name = __stringify(_name) }, \ | 191 | .kobj = { .k_name = __stringify(_name) }, \ |
197 | .ktype = _type, \ | ||
198 | .uevent_ops =_uevent_ops, \ | 192 | .uevent_ops =_uevent_ops, \ |
199 | } | 193 | } |
200 | #define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ | 194 | #define decl_subsys_name(_varname,_name,_uevent_ops) \ |
201 | struct kset _varname##_subsys = { \ | 195 | struct kset _varname##_subsys = { \ |
202 | .kobj = { .k_name = __stringify(_name) }, \ | 196 | .kobj = { .k_name = __stringify(_name) }, \ |
203 | .ktype = _type, \ | ||
204 | .uevent_ops =_uevent_ops, \ | 197 | .uevent_ops =_uevent_ops, \ |
205 | } | 198 | } |
206 | 199 | ||
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 65daa5373ca6..094e2bc101a8 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c | |||
@@ -94,7 +94,7 @@ static struct bin_attribute notes_attr = { | |||
94 | .read = ¬es_read, | 94 | .read = ¬es_read, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | decl_subsys(kernel, NULL, NULL); | 97 | decl_subsys(kernel, NULL); |
98 | EXPORT_SYMBOL_GPL(kernel_subsys); | 98 | EXPORT_SYMBOL_GPL(kernel_subsys); |
99 | 99 | ||
100 | static struct attribute * kernel_attrs[] = { | 100 | static struct attribute * kernel_attrs[] = { |
diff --git a/kernel/module.c b/kernel/module.c index c2e3e2e98801..68df79738b3b 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1223,7 +1223,7 @@ int mod_sysfs_init(struct module *mod) | |||
1223 | err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name); | 1223 | err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name); |
1224 | if (err) | 1224 | if (err) |
1225 | goto out; | 1225 | goto out; |
1226 | kobj_set_kset_s(&mod->mkobj, module_subsys); | 1226 | mod->mkobj.kobj.kset = &module_subsys; |
1227 | mod->mkobj.mod = mod; | 1227 | mod->mkobj.mod = mod; |
1228 | 1228 | ||
1229 | kobject_init(&mod->mkobj.kobj); | 1229 | kobject_init(&mod->mkobj.kobj); |
diff --git a/kernel/params.c b/kernel/params.c index 7686417ee00e..9f051824097d 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #define DEBUGP(fmt, a...) | 30 | #define DEBUGP(fmt, a...) |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | static struct kobj_type module_ktype; | ||
34 | |||
33 | static inline char dash2underscore(char c) | 35 | static inline char dash2underscore(char c) |
34 | { | 36 | { |
35 | if (c == '-') | 37 | if (c == '-') |
@@ -560,7 +562,8 @@ static void __init kernel_param_sysfs_setup(const char *name, | |||
560 | BUG_ON(!mk); | 562 | BUG_ON(!mk); |
561 | 563 | ||
562 | mk->mod = THIS_MODULE; | 564 | mk->mod = THIS_MODULE; |
563 | kobj_set_kset_s(mk, module_subsys); | 565 | mk->kobj.kset = &module_subsys; |
566 | mk->kobj.ktype = &module_ktype; | ||
564 | kobject_set_name(&mk->kobj, name); | 567 | kobject_set_name(&mk->kobj, name); |
565 | kobject_init(&mk->kobj); | 568 | kobject_init(&mk->kobj); |
566 | ret = kobject_add(&mk->kobj); | 569 | ret = kobject_add(&mk->kobj); |
@@ -679,8 +682,6 @@ static struct sysfs_ops module_sysfs_ops = { | |||
679 | .store = module_attr_store, | 682 | .store = module_attr_store, |
680 | }; | 683 | }; |
681 | 684 | ||
682 | static struct kobj_type module_ktype; | ||
683 | |||
684 | static int uevent_filter(struct kset *kset, struct kobject *kobj) | 685 | static int uevent_filter(struct kset *kset, struct kobject *kobj) |
685 | { | 686 | { |
686 | struct kobj_type *ktype = get_ktype(kobj); | 687 | struct kobj_type *ktype = get_ktype(kobj); |
@@ -694,7 +695,7 @@ static struct kset_uevent_ops module_uevent_ops = { | |||
694 | .filter = uevent_filter, | 695 | .filter = uevent_filter, |
695 | }; | 696 | }; |
696 | 697 | ||
697 | decl_subsys(module, &module_ktype, &module_uevent_ops); | 698 | decl_subsys(module, &module_uevent_ops); |
698 | int module_sysfs_initialized; | 699 | int module_sysfs_initialized; |
699 | 700 | ||
700 | static void module_release(struct kobject *kobj) | 701 | static void module_release(struct kobject *kobj) |
diff --git a/kernel/power/main.c b/kernel/power/main.c index f71c9504a5c5..1ef31c91ce0e 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -276,7 +276,7 @@ EXPORT_SYMBOL(pm_suspend); | |||
276 | 276 | ||
277 | #endif /* CONFIG_SUSPEND */ | 277 | #endif /* CONFIG_SUSPEND */ |
278 | 278 | ||
279 | decl_subsys(power,NULL,NULL); | 279 | decl_subsys(power, NULL); |
280 | 280 | ||
281 | 281 | ||
282 | /** | 282 | /** |
@@ -3962,7 +3962,7 @@ static struct kset_uevent_ops slab_uevent_ops = { | |||
3962 | .filter = uevent_filter, | 3962 | .filter = uevent_filter, |
3963 | }; | 3963 | }; |
3964 | 3964 | ||
3965 | static decl_subsys(slab, &slab_ktype, &slab_uevent_ops); | 3965 | static decl_subsys(slab, &slab_uevent_ops); |
3966 | 3966 | ||
3967 | #define ID_STR_LENGTH 64 | 3967 | #define ID_STR_LENGTH 64 |
3968 | 3968 | ||
@@ -4025,8 +4025,9 @@ static int sysfs_slab_add(struct kmem_cache *s) | |||
4025 | name = create_unique_id(s); | 4025 | name = create_unique_id(s); |
4026 | } | 4026 | } |
4027 | 4027 | ||
4028 | kobj_set_kset_s(s, slab_subsys); | ||
4029 | kobject_set_name(&s->kobj, name); | 4028 | kobject_set_name(&s->kobj, name); |
4029 | s->kobj.kset = &slab_subsys; | ||
4030 | s->kobj.ktype = &slab_ktype; | ||
4030 | kobject_init(&s->kobj); | 4031 | kobject_init(&s->kobj); |
4031 | err = kobject_add(&s->kobj); | 4032 | err = kobject_add(&s->kobj); |
4032 | if (err) | 4033 | if (err) |
diff --git a/security/inode.c b/security/inode.c index b28a8acae34d..9e42f5f705b2 100644 --- a/security/inode.c +++ b/security/inode.c | |||
@@ -315,13 +315,13 @@ void securityfs_remove(struct dentry *dentry) | |||
315 | } | 315 | } |
316 | EXPORT_SYMBOL_GPL(securityfs_remove); | 316 | EXPORT_SYMBOL_GPL(securityfs_remove); |
317 | 317 | ||
318 | static decl_subsys(security, NULL, NULL); | 318 | static decl_subsys(security, NULL); |
319 | 319 | ||
320 | static int __init securityfs_init(void) | 320 | static int __init securityfs_init(void) |
321 | { | 321 | { |
322 | int retval; | 322 | int retval; |
323 | 323 | ||
324 | kobj_set_kset_s(&security_subsys, kernel_subsys); | 324 | security_subsys.kobj.kset = &kernel_subsys; |
325 | retval = subsystem_register(&security_subsys); | 325 | retval = subsystem_register(&security_subsys); |
326 | if (retval) | 326 | if (retval) |
327 | return retval; | 327 | return retval; |