Results 1 to 1 of 1
Hi all,
I am working on device drivers, which is responsible for creating a SYSFS directory under /sys/class/hwmon.
I have already applied a patch over the hwmon.c file with the ...
- 06-15-2009 #1Just Joined!
- Join Date
- Feb 2009
- Location
- Chennai, India
- Posts
- 28
SYSFS Folder Creation Problem
Hi all,
I am working on device drivers, which is responsible for creating a SYSFS directory under /sys/class/hwmon.
I have already applied a patch over the hwmon.c file with the following function
Now in my driver init part i have written the following code.Code:struct class * get_hwclass() { return hwmon_class }
Code:static int my_init() { struct kobject *my_kobj; struct class *hw_cls; hw_cls = get_hwclass(); ...... my_kobj = kobject_create_and_add ( "bala", hw_cls->dev_kobj ); if(my_kobj == NULL) { printk(KERN_ERR "Can't create a sysfs directory\n"); retval = -ENOMEM; goto error; } kobject_uevent(my_kobj, KOBJ_ADD); error: ...... }
But, when i try to load my module i am not able to see "bala" SYSFS directory under /sys/class/hwmon. And also i have checked my syslog file it doesn't have any error prints.
Am i missing something here.....


Reply With Quote