public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Artem B. Bityutskiy" <dedekind@yandex.ru>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org
Subject: device model and character devices
Date: Tue, 04 Apr 2006 12:12:31 +0400	[thread overview]
Message-ID: <44322A6F.4000402@yandex.ru> (raw)

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.

             reply	other threads:[~2006-04-04  8:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-04  8:12 Artem B. Bityutskiy [this message]
2006-04-04 16:48 ` device model and character devices Greg KH
2006-04-05  7:52   ` Artem B. Bityutskiy
2006-04-05 18:31     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44322A6F.4000402@yandex.ru \
    --to=dedekind@yandex.ru \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox