|
@@ -387,6 +387,11 @@ EXPORT_SYMBOL_GPL(kobject_init_and_add);
|
|
* kobject_rename - change the name of an object
|
|
* kobject_rename - change the name of an object
|
|
* @kobj: object in question.
|
|
* @kobj: object in question.
|
|
* @new_name: object's new name
|
|
* @new_name: object's new name
|
|
|
|
+ *
|
|
|
|
+ * It is the responsibility of the caller to provide mutual
|
|
|
|
+ * exclusion between two different calls of kobject_rename
|
|
|
|
+ * on the same kobject and to ensure that new_name is valid and
|
|
|
|
+ * won't conflict with other kobjects.
|
|
*/
|
|
*/
|
|
int kobject_rename(struct kobject *kobj, const char *new_name)
|
|
int kobject_rename(struct kobject *kobj, const char *new_name)
|
|
{
|
|
{
|
|
@@ -401,19 +406,6 @@ int kobject_rename(struct kobject *kobj, const char *new_name)
|
|
if (!kobj->parent)
|
|
if (!kobj->parent)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- /* see if this name is already in use */
|
|
|
|
- if (kobj->kset) {
|
|
|
|
- struct kobject *temp_kobj;
|
|
|
|
- temp_kobj = kset_find_obj(kobj->kset, new_name);
|
|
|
|
- if (temp_kobj) {
|
|
|
|
- printk(KERN_WARNING "kobject '%s' cannot be renamed "
|
|
|
|
- "to '%s' as '%s' is already in existence.\n",
|
|
|
|
- kobject_name(kobj), new_name, new_name);
|
|
|
|
- kobject_put(temp_kobj);
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
devpath = kobject_get_path(kobj, GFP_KERNEL);
|
|
devpath = kobject_get_path(kobj, GFP_KERNEL);
|
|
if (!devpath) {
|
|
if (!devpath) {
|
|
error = -ENOMEM;
|
|
error = -ENOMEM;
|