cdevsw_add() vs make_dev()

Chuck Tuffli chuck_tuffli at
Tue Oct 5 09:33:56 PDT 2004

In my continuing quest to port a driver from Free to DFly, I've run
into something I don't understand with the device structures. In Free,
if the driver exported an ioctl interface, it defined the ioctl
handler in struct cdevsw and called something like

make_dev(&svd_cdevsw, device_get_unit(dev), UID_ROOT,
	GID_OPERATOR, 0600, "%s", device_get_nameunit(dev));

Doing this on DFly doesn't seem sufficient. Apps making an ioctl to
this device error out on the open with a 'Device not configured' error
message. Investigating a little, I found that other drivers added a
call to

cdevsw_add(&svd_cdevsw, -1, device_get_unit(dev));

What is this call doing differently than what make_dev provides?

Chuck Tuffli
Agilent Technologies

More information about the Kernel mailing list