浏览代码

Kobject: remove kobject_register()

The function is no longer used by anyone in the kernel, and it prevents
the proper sending of the kobject uevent after the needed files are set
up by the caller.  kobject_init_and_add() can be used in its place.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Greg Kroah-Hartman 17 年之前
父节点
当前提交
6d06adfaf8
共有 2 个文件被更改,包括 0 次插入19 次删除
  1. 0 1
      include/linux/kobject.h
  2. 0 18
      lib/kobject.c

+ 0 - 1
include/linux/kobject.h

@@ -96,7 +96,6 @@ extern struct kobject * __must_check kobject_create_and_add(const char *name,
 extern int __must_check kobject_rename(struct kobject *, const char *new_name);
 extern int __must_check kobject_rename(struct kobject *, const char *new_name);
 extern int __must_check kobject_move(struct kobject *, struct kobject *);
 extern int __must_check kobject_move(struct kobject *, struct kobject *);
 
 
-extern int __must_check kobject_register(struct kobject *);
 extern void kobject_unregister(struct kobject *);
 extern void kobject_unregister(struct kobject *);
 
 
 extern struct kobject * kobject_get(struct kobject *);
 extern struct kobject * kobject_get(struct kobject *);

+ 0 - 18
lib/kobject.c

@@ -219,23 +219,6 @@ static int kobject_add_internal(struct kobject *kobj)
 	return error;
 	return error;
 }
 }
 
 
-/**
- *	kobject_register - initialize and add an object.
- *	@kobj:	object in question.
- */
-
-int kobject_register(struct kobject * kobj)
-{
-	int error = -EINVAL;
-	if (kobj) {
-		kobject_init_internal(kobj);
-		error = kobject_add(kobj);
-		if (!error)
-			kobject_uevent(kobj, KOBJ_ADD);
-	}
-	return error;
-}
-
 /**
 /**
  * kobject_set_name_vargs - Set the name of an kobject
  * kobject_set_name_vargs - Set the name of an kobject
  * @kobj: struct kobject to set the name of
  * @kobj: struct kobject to set the name of
@@ -883,7 +866,6 @@ struct kset *kset_create_and_add(const char *name,
 }
 }
 EXPORT_SYMBOL_GPL(kset_create_and_add);
 EXPORT_SYMBOL_GPL(kset_create_and_add);
 
 
-EXPORT_SYMBOL(kobject_register);
 EXPORT_SYMBOL(kobject_unregister);
 EXPORT_SYMBOL(kobject_unregister);
 EXPORT_SYMBOL(kobject_get);
 EXPORT_SYMBOL(kobject_get);
 EXPORT_SYMBOL(kobject_put);
 EXPORT_SYMBOL(kobject_put);