public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* device model and character devices
@ 2006-04-04  8:12 Artem B. Bityutskiy
  2006-04-04 16:48 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Artem B. Bityutskiy @ 2006-04-04  8:12 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

Hello Greg,

at the moment the device model and the character devices subsystem are 
distinct and different things. I mean, if I have a device xdev, I do the 
following:

struct xdev_device {
	struct cdev cdev;
	struct device dev;
	/* xdev-specific stuff */
	...
} xdev;

I use xdev.cdev to register character device:

cdev_add(&xdev.cdev, ...);
...

I use xdev.dev functions to include my device to the device-model:

device_register(&xdev.dev, ...);
...

But why not to merge the character device stuff and the device model? 
Roughly speaking, why not to embed 'struct cdev' to 'struct device'? Why 
do driver writers have to distinguish between these things?

Thanks.

-- 
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-05 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-04  8:12 device model and character devices Artem B. Bityutskiy
2006-04-04 16:48 ` Greg KH
2006-04-05  7:52   ` Artem B. Bityutskiy
2006-04-05 18:31     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox