Re: Associating driver to the existing device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey! wait a minute.....forget my previous reply.
where are you registering your open fxn. in the fops struct???

Yeah !! this is the only, way i know....
static struct file_operations my_fops = {
        .read = my_read,
        .write = my_write,
        .open = my_open,
        .release = my_release
};

and this is the snippet of the code.... where i am doing this
my_cdev.ops =&my_fops;
rv = cdev_add(&my_cdev,devno,1);

(I'm assuming you have shown us your complete code)

Yes...
 

Your open is not going to get called automagically! :)

this is my_open implementation
static int my_open(struct inode *imem, struct file *fmem)
{
printk("<1> INSIDE my_open ..................\n");
return 1;

Regards,
Vishal.


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux