#ifdef CONFIG_SYSFS
struct module;
-extern struct kset module_subsys;
+extern struct kset *module_kset;
+extern struct kobj_type module_ktype;
+extern int module_sysfs_initialized;
int mod_sysfs_init(struct module *mod);
int mod_sysfs_setup(struct module *mod,
#include <asm/cacheflush.h>
#include <linux/license.h>
-extern int module_sysfs_initialized;
-
#if 0
#define DEBUGP printk
#else
err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name);
if (err)
goto out;
- mod->mkobj.kobj.kset = &module_subsys;
+ mod->mkobj.kobj.kset = module_kset;
+ mod->mkobj.kobj.ktype = &module_ktype;
mod->mkobj.mod = mod;
kobject_init(&mod->mkobj.kobj);
struct kobject *mkobj;
/* Lookup built-in module entry in /sys/modules */
- mkobj = kset_find_obj(&module_subsys, drv->mod_name);
+ mkobj = kset_find_obj(module_kset, drv->mod_name);
if (mkobj) {
mk = container_of(mkobj, struct module_kobject, kobj);
/* remember our module structure */
#define DEBUGP(fmt, a...)
#endif
-static struct kobj_type module_ktype;
-
static inline char dash2underscore(char c)
{
if (c == '-')
BUG_ON(!mk);
mk->mod = THIS_MODULE;
- mk->kobj.kset = &module_subsys;
+ mk->kobj.kset = module_kset;
mk->kobj.ktype = &module_ktype;
kobject_set_name(&mk->kobj, name);
kobject_init(&mk->kobj);
.filter = uevent_filter,
};
-decl_subsys(module, &module_uevent_ops);
+struct kset *module_kset;
int module_sysfs_initialized;
static void module_release(struct kobject *kobj)
*/
}
-static struct kobj_type module_ktype = {
+struct kobj_type module_ktype = {
.sysfs_ops = &module_sysfs_ops,
.release = module_release,
};
*/
static int __init param_sysfs_init(void)
{
- int ret;
-
- ret = subsystem_register(&module_subsys);
- if (ret < 0) {
- printk(KERN_WARNING "%s (%d): subsystem_register error: %d\n",
- __FILE__, __LINE__, ret);
- return ret;
+ module_kset = kset_create_and_add("module", &module_uevent_ops, NULL);
+ if (!module_kset) {
+ printk(KERN_WARNING "%s (%d): error creating kset\n",
+ __FILE__, __LINE__);
+ return -ENOMEM;
}
module_sysfs_initialized = 1;
}
subsys_initcall(param_sysfs_init);
-#else
-#if 0
-static struct sysfs_ops module_sysfs_ops = {
- .show = NULL,
- .store = NULL,
-};
-#endif
-#endif
+#endif /* CONFIG_SYSFS */
EXPORT_SYMBOL(param_set_byte);
EXPORT_SYMBOL(param_get_byte);