registering a character driver without cdev_init()/cdev_add()

Greg KH greg at kroah.com
Wed May 4 11:35:44 EDT 2011


On Wed, May 04, 2011 at 06:55:17AM -0400, Robert P. J. Day wrote:
>   so rather than the canonical combination of cdev_init() and
> cdev_add(), this appears to register the pre-defined DSP56K major
> number, then goes straight to registering the driver with sysfs.
> 
>   is this now an alternative way of registering character drivers, if
> you want to register them with sysfs as well?  as i read it,
> device_create() will create the /dev file so is this just a newer way
> to register character drivers?

device_create will create the /dev file, but you have to have registered
that major/minor number before calling it, it does not do the
registering for you.

thanks,

greg k-h



More information about the Kernelnewbies mailing list