Re: register_chrdev vs. cdev_add

From: Jonathan Corbet
Date: Wed May 14 2008 - 10:01:44 EST


> dev = MKDEV(htrc110_major, htrc110_minor);
> ret = register_chrdev_region(dev, 1, mod_name);
> ret = register_chrdev(dev, mod_name, &htrc110_fops);

If you want to use register_chrdev(), do not make a separate call to
register_chrdev_region(). Those two are not meant to work together.
register_chrdev() implicitly allocates a region of 256 minors for you.

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/