static ssize_t device_read (struct file* filp, char *bufStoreData, size_t bufCount, loff_t* curOffset)
{
printk(KERN_INFO"reading from the device");
ret = copy_to_user(bufStoreData,virtual_device.data,bufCount);
return ret;
}
static ssize_t device_write(struct file *filp,const char* bufSourceData,size_t bufCount, loff_t* curOffset)
{
printk(KERN_INFO"writing to device");
ret=copy_from_user(virtual_device.data,bufSourceData,bufCount);
return ret;
}
I was using echo and cat command to do the user write and read but i was not reading the data properly. Maybe i am not returning right values.Is that so?