lkml.org 
[lkml]   [2006]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdevice model and character devices
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-04 10:15    [from the cache]
©2003-2011 Jasper Spaans