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

Code:
struct class * get_hwclass()
{
       return hwmon_class
}
Now in my driver init part i have written the following code.

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.....