aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-21 18:13:54 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-21 18:13:54 -0500
commitb3e8d7b2478401b2f25f4566a90faad54f7d6d07 (patch)
treedd3904d89a2e545ac5c751ad7bf42012164f92f0 /lib
parenta6ec0c03a039677e4b4b5a67a6e19e9e26303000 (diff)
kobject: remove kset_find_obj_hinted()
Now that there are no in-kernel users of this function, remove it as it is no longer needed. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 640bd98a4c8a..c33d7a18d635 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -746,43 +746,11 @@ void kset_unregister(struct kset *k)
746 */ 746 */
747struct kobject *kset_find_obj(struct kset *kset, const char *name) 747struct kobject *kset_find_obj(struct kset *kset, const char *name)
748{ 748{
749 return kset_find_obj_hinted(kset, name, NULL);
750}
751
752/**
753 * kset_find_obj_hinted - search for object in kset given a predecessor hint.
754 * @kset: kset we're looking in.
755 * @name: object's name.
756 * @hint: hint to possible object's predecessor.
757 *
758 * Check the hint's next object and if it is a match return it directly,
759 * otherwise, fall back to the behavior of kset_find_obj(). Either way
760 * a reference for the returned object is held and the reference on the
761 * hinted object is released.
762 */
763struct kobject *kset_find_obj_hinted(struct kset *kset, const char *name,
764 struct kobject *hint)
765{
766 struct kobject *k; 749 struct kobject *k;
767 struct kobject *ret = NULL; 750 struct kobject *ret = NULL;
768 751
769 spin_lock(&kset->list_lock); 752 spin_lock(&kset->list_lock);
770 753
771 if (!hint)
772 goto slow_search;
773
774 /* end of list detection */
775 if (hint->entry.next == kset->list.next)
776 goto slow_search;
777
778 k = container_of(hint->entry.next, struct kobject, entry);
779 if (!kobject_name(k) || strcmp(kobject_name(k), name))
780 goto slow_search;
781
782 ret = kobject_get(k);
783 goto unlock_exit;
784
785slow_search:
786 list_for_each_entry(k, &kset->list, entry) { 754 list_for_each_entry(k, &kset->list, entry) {
787 if (kobject_name(k) && !strcmp(kobject_name(k), name)) { 755 if (kobject_name(k) && !strcmp(kobject_name(k), name)) {
788 ret = kobject_get(k); 756 ret = kobject_get(k);
@@ -790,12 +758,7 @@ slow_search:
790 } 758 }
791 } 759 }
792 760
793unlock_exit:
794 spin_unlock(&kset->list_lock); 761 spin_unlock(&kset->list_lock);
795
796 if (hint)
797 kobject_put(hint);
798
799 return ret; 762 return ret;
800} 763}
801 764