diff options
Diffstat (limited to 'drivers/firmware/edd.c')
-rw-r--r-- | drivers/firmware/edd.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index 6942e065e609..d168223db159 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 struct kset *edd_kset; |
635 | 635 | ||
636 | 636 | ||
637 | /** | 637 | /** |
@@ -693,7 +693,7 @@ edd_create_symlink_to_pcidev(struct edd_device *edev) | |||
693 | static inline void | 693 | static inline void |
694 | edd_device_unregister(struct edd_device *edev) | 694 | edd_device_unregister(struct edd_device *edev) |
695 | { | 695 | { |
696 | kobject_unregister(&edev->kobj); | 696 | kobject_put(&edev->kobj); |
697 | } | 697 | } |
698 | 698 | ||
699 | static void edd_populate_dir(struct edd_device * edev) | 699 | static void edd_populate_dir(struct edd_device * edev) |
@@ -721,12 +721,13 @@ edd_device_register(struct edd_device *edev, int i) | |||
721 | if (!edev) | 721 | if (!edev) |
722 | return 1; | 722 | return 1; |
723 | edd_dev_set_info(edev, i); | 723 | edd_dev_set_info(edev, i); |
724 | kobject_set_name(&edev->kobj, "int13_dev%02x", | 724 | edev->kobj.kset = edd_kset; |
725 | 0x80 + i); | 725 | error = kobject_init_and_add(&edev->kobj, &edd_ktype, NULL, |
726 | kobj_set_kset_s(edev,edd_subsys); | 726 | "int13_dev%02x", 0x80 + i); |
727 | error = kobject_register(&edev->kobj); | 727 | if (!error) { |
728 | if (!error) | ||
729 | edd_populate_dir(edev); | 728 | edd_populate_dir(edev); |
729 | kobject_uevent(&edev->kobj, KOBJ_ADD); | ||
730 | } | ||
730 | return error; | 731 | return error; |
731 | } | 732 | } |
732 | 733 | ||
@@ -755,9 +756,9 @@ edd_init(void) | |||
755 | return 1; | 756 | return 1; |
756 | } | 757 | } |
757 | 758 | ||
758 | rc = firmware_register(&edd_subsys); | 759 | edd_kset = kset_create_and_add("edd", NULL, firmware_kobj); |
759 | if (rc) | 760 | if (!edd_kset) |
760 | return rc; | 761 | return -ENOMEM; |
761 | 762 | ||
762 | for (i = 0; i < edd_num_devices() && !rc; i++) { | 763 | for (i = 0; i < edd_num_devices() && !rc; i++) { |
763 | edev = kzalloc(sizeof (*edev), GFP_KERNEL); | 764 | edev = kzalloc(sizeof (*edev), GFP_KERNEL); |
@@ -773,7 +774,7 @@ edd_init(void) | |||
773 | } | 774 | } |
774 | 775 | ||
775 | if (rc) | 776 | if (rc) |
776 | firmware_unregister(&edd_subsys); | 777 | kset_unregister(edd_kset); |
777 | return rc; | 778 | return rc; |
778 | } | 779 | } |
779 | 780 | ||
@@ -787,7 +788,7 @@ edd_exit(void) | |||
787 | if ((edev = edd_devices[i])) | 788 | if ((edev = edd_devices[i])) |
788 | edd_device_unregister(edev); | 789 | edd_device_unregister(edev); |
789 | } | 790 | } |
790 | firmware_unregister(&edd_subsys); | 791 | kset_unregister(edd_kset); |
791 | } | 792 | } |
792 | 793 | ||
793 | late_initcall(edd_init); | 794 | late_initcall(edd_init); |