public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: corbet@lwn.net (Jonathan Corbet)
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RFC: Attributes in /sys/cdev
Date: Mon, 22 Sep 2003 10:46:09 -0600	[thread overview]
Message-ID: <20030922164609.5929.qmail@lwn.net> (raw)
In-Reply-To: Your message of "Sat, 20 Sep 2003 02:28:44 BST." <20030920012844.GD7665@parcelfarce.linux.theplanet.co.uk>

> > I have no idea whether this follows the original plan for /sys/cdev.
> 
> They are more of a side effect.

So...to be sure I have things straight.../sys/cdev isn't really meant to be
there, and char devices wanting to do things in sysfs should be working
under /sys/devices or /sys/class or /sys/somethingelse?

> 	* driver has embedded struct cdev in its data structures

> 	* ->open() can use ->i_cdev to get whatever data structure driver
> had intended and avoid any lookups of its own

I noticed there's no "private" member in the cdev structure.  So drivers
should embed the structure and use container_of to get their real structure
of interest?

[Forgive my ignorance here...] If I embed a struct cdev within my own
device structure, how do I know when I can safely free said device
structure?  Will there be a release method that gets exposed at the driver
level, or am I missing something obvious again?

Thanks,

jon

Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net

  parent reply	other threads:[~2003-09-22 16:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-19 23:10 [PATCH] RFC: Attributes in /sys/cdev Jonathan Corbet
2003-09-19 23:32 ` Greg KH
2003-09-20  1:28 ` viro
2003-09-20  2:47   ` Greg KH
2003-09-22 16:29   ` Patrick Mochel
2003-09-22 16:46   ` Jonathan Corbet [this message]
2003-09-22 21:00     ` viro
2003-09-22 21:15       ` Jonathan Corbet
2003-09-22 22:37         ` viro
2003-09-24 22:22           ` 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=20030922164609.5929.qmail@lwn.net \
    --to=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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