aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/edd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:34:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:35:13 -0500
commitdf8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e (patch)
treebc3799a43e8b94fa84b32e37b1c124d5e4868f50 /drivers/firmware/edd.c
parent556a169dab38b5100df6f4a45b655dddd3db94c1 (diff)
parent4a3ad20ccd8f4d2a0535cf98fa83f7b561ba59a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
This can be broken down into these major areas: - Documentation updates (language translations and fixes, as well as kobject and kset documenatation updates.) - major kset/kobject/ktype rework and fixes. This cleans up the kset and kobject and ktype relationship and architecture, making sense of things now, and good documenation and samples are provided for others to use. Also the attributes for kobjects are much easier to handle now. This cleaned up a LOT of code all through the kernel, making kobjects easier to use if you want to. - struct bus_type has been reworked to now handle the lifetime rules properly, as the kobject is properly dynamic. - struct driver has also been reworked, and now the lifetime issues are resolved. - the block subsystem has been converted to use struct device now, and not "raw" kobjects. This patch has been in the -mm tree for over a year now, and finally all the issues are worked out with it. Older distros now properly work with new kernels, and no userspace updates are needed at all. - nozomi driver is added. This has also been in -mm for a long time, and many people have asked for it to go in. It is now in good enough shape to do so. - lots of class_device conversions to use struct device instead. The tree is almost all cleaned up now, only SCSI and IB is the remaining code to fix up... * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits) Driver core: coding style fixes Kobject: fix coding style issues in kobject c files Kobject: fix coding style issues in kobject.h Driver core: fix coding style issues in device.h spi: use class iteration api scsi: use class iteration api rtc: use class iteration api power supply : use class iteration api ieee1394: use class iteration api Driver Core: add class iteration api Driver core: Cleanup get_device_parent() in device_add() and device_move() UIO: constify function pointer tables Driver Core: constify the name passed to platform_device_register_simple driver core: fix build with SYSFS=n sysfs: make SYSFS_DEPRECATED depend on SYSFS Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init kobject: add sample code for how to use ksets/ktypes/kobjects kobject: add sample code for how to use kobjects in a simple manner. kobject: update the kobject/kset documentation kobject: remove old, outdated documentation. ...
Diffstat (limited to 'drivers/firmware/edd.c')
-rw-r--r--drivers/firmware/edd.c25
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
634static decl_subsys(edd, &edd_ktype, NULL); 634static struct kset *edd_kset;
635 635
636 636
637/** 637/**
@@ -693,7 +693,7 @@ edd_create_symlink_to_pcidev(struct edd_device *edev)
693static inline void 693static inline void
694edd_device_unregister(struct edd_device *edev) 694edd_device_unregister(struct edd_device *edev)
695{ 695{
696 kobject_unregister(&edev->kobj); 696 kobject_put(&edev->kobj);
697} 697}
698 698
699static void edd_populate_dir(struct edd_device * edev) 699static 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
793late_initcall(edd_init); 794late_initcall(edd_init);