static struct kobject *virtual_dir = NULL;
if (!virtual_dir)
- virtual_dir = kobject_add_dir(&devices_subsys.kobj, "virtual");
+ virtual_dir = kobject_create_and_add("virtual",
+ &devices_subsys.kobj);
return virtual_dir;
}
struct kobject *k;
k = kobject_get(&p->kobj);
- p->holder_dir = kobject_add_dir(k, "holders");
+ p->holder_dir = kobject_create_and_add("holders", k);
kobject_put(k);
}
struct kobject *k;
k = kobject_get(&disk->kobj);
- disk->holder_dir = kobject_add_dir(k, "holders");
- disk->slave_dir = kobject_add_dir(k, "slaves");
+ disk->holder_dir = kobject_create_and_add("holders", k);
+ disk->slave_dir = kobject_create_and_add("slaves", k);
kobject_put(k);
}
extern struct kobject *kobject_kset_add_dir(struct kset *kset,
struct kobject *, const char *);
-extern struct kobject *kobject_add_dir(struct kobject *, const char *);
extern char * kobject_get_path(struct kobject *, gfp_t);
++loaded;
}
- notes_attrs->dir = kobject_add_dir(&mod->mkobj.kobj, "notes");
+ notes_attrs->dir = kobject_create_and_add("notes", &mod->mkobj.kobj);
if (!notes_attrs->dir)
goto out;
if (err)
goto out;
- mod->holders_dir = kobject_add_dir(&mod->mkobj.kobj, "holders");
+ mod->holders_dir = kobject_create_and_add("holders", &mod->mkobj.kobj);
if (!mod->holders_dir) {
err = -ENOMEM;
goto out_unreg;
if (!mk || mk->drivers_dir)
return;
- mk->drivers_dir = kobject_add_dir(&mk->kobj, "drivers");
+ mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj);
}
void module_add_driver(struct module *mod, struct device_driver *drv)
}
/**
- * kobject_add_dir - add sub directory of object.
- * @parent: object in which a directory is created.
- * @name: directory name.
- *
- * Add a plain directory object as child of given object.
- */
-struct kobject *kobject_add_dir(struct kobject *parent, const char *name)
-{
- return kobject_create_and_add(name, parent);
-}
-
-/**
* kset_init - initialize a kset for use
* @k: kset
*/