Re: Device driver registration problem

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

 



Hi,


        err = cdev_add(&dev->myi_cdev, devno, 1);

probably you should change the '1' here to number of minor numbers that you use.

Anand

        if (err)
                goto err;
        else
                return;

err:
        printk(KERN_ERR "Error %d while adding %s", err, dev->name);
}

After this (long) introduction, my problem : when i am registering
several devices, only device 0 is working, that is to say, when
opening /dev/my_device0, the open function of my driver is called. But
for all the other device numbers, I get the error "No such device or
address".

I really don't see where the problem comes from. I checked with the
debugger that the initialization is ok for each device.
Is it problematic that I call register_chrdev_region and cdev_add not
during module_init but after ?

Thanks in advance for any idea,

Ivan

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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