public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Sysfs group create for empty groups.
@ 2011-08-17 10:17 Jonathan Cameron
  2011-08-17 10:17 ` [PATCH 1/2] sysfs: Allow for null group pointer in create_group Jonathan Cameron
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jonathan Cameron @ 2011-08-17 10:17 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: greg, Jonathan Cameron

The following is a quick stab at avoiding a hideous work around
we are currently using in IIO.  In some cases we have entire
attribute groups that are created from descriptions an array
of struct iio_chan_spec.  To keep the reference counts sane
and cause subdirectories to be created we are currently using
dummy groups and dummy attribute arrays (provided once in the
core).  This series is an initial probably stupid approach
to avoiding this.

Greg has expressed some doubts about whether subdirectories are
ever a good idea, but the problem occurs for the top level
directory as well (handled by patch 1).

Note, all attributes are created at probe time.  Ultimately we
are just respinning the create_group code to allow us to create
the attributes from a device description rather than statically
allocating them in each driver (results in a massive reduction
in repeated code).

All opinions welcomed.

(this is definitely an rfc, the code isn't even tested yet)

Jonathan

p.s. Greg, sorry for pestering about this!

Jonathan Cameron (2):
  sysfs: Allow for null group pointer in create_group
  sysfs: Allow for groups with no attributes - grp->attrs = NULL.

 fs/sysfs/group.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

-- 
1.7.3.4


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

end of thread, other threads:[~2011-08-23 22:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-17 10:17 [RFC PATCH 0/2] Sysfs group create for empty groups Jonathan Cameron
2011-08-17 10:17 ` [PATCH 1/2] sysfs: Allow for null group pointer in create_group Jonathan Cameron
2011-08-17 10:17 ` [PATCH 2/2] sysfs: Allow for groups with no attributes - grp->attrs = NULL Jonathan Cameron
2011-08-17 16:27 ` [RFC PATCH 0/2] Sysfs group create for empty groups Jonathan Cameron
2011-08-23  0:33   ` Greg KH
2011-08-23 11:01     ` Jonathan Cameron
2011-08-23 19:25       ` Jonathan Cameron
2011-08-23 22:03         ` Greg KH

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