Re: help about device driver

From: Greg KH
Date: Wed Dec 21 2011 - 22:53:28 EST


On Thu, Dec 22, 2011 at 10:55:49AM +0800, mengdeguo wrote:
> Hi,
>
>
>
> I find a problem very confusing. Devices are divided into char/block/network dev. By the definition i2c, usb ,input devices belong to char devices. But walk across all the device driver, I can not find the cdev struct for them (i2c ,usb ,input devices). What's the problem ? This devices don't need cdev, if so, what do we do to associate file_operations with dev node?

What device node is associated with a usb device?

cdev structures are only there for character device nodes, the majority
of drivers never use that at all, that's what the different "class"es
are for (input, tty, misc, etc.)

greg k-h
--
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/