Re: char dev

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

 



On 9/7/05, Greg KH <greg@xxxxxxxxx> wrote:
> 
> On Tue, Sep 06, 2005 at 09:11:45AM +0530, raja wrote:
> > It is compiling and the module is inserting.
> 
> This is working on 2.6?  Which kernel version?
> 
>  
>  
> > printk("Hello World 4 \n");
> > int ret_val = register_chrdev_region(start,count,NAME); 
>  
> > Is there any wrong with using the function call?
> 
> Incorrectly, yes, it will oops.
> 

here you are calling register_chrdev_region with start, count and NAME
......... where
dev_t start = 255;       This would be in the form of Major,Minor
...... and you are only assigning to it and this will make
start=0x00FF (here major=0 and minor=255) and then
register_chrdev_region tries to __register_chrdev_region from 0 to 10
(10 is what you provided in count) !!! and almost all majors from 0 to
10 are already registered with kernel by other devices ....

by the way I don't know what register_chrdev_region does b/c I m
working on block devices not on char devices, but I m telling you what
I realized from looking at the code of register_chrdev_region ....
(CMIIW)



-- 
Fawad Lateef

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