public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Greg KH <greg@kroah.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Michael Buesch <mb@bu3sch.de>,
	sfr@canb.auug.org.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpiolib: Allow user-selection
Date: Fri, 11 Jul 2008 22:32:43 -0700	[thread overview]
Message-ID: <200807112232.43293.david-b@pacbell.net> (raw)
In-Reply-To: <20080703230802.GB21898@kroah.com>

On Thursday 03 July 2008, Greg KH wrote:
> > The scenario is that gpios sometimes get initialized very early,
> > as part of board setup before kmalloc or irqs work, so when they
> > get registered sometimes there's work left over for later.  All
> > that's needed is a predicate to test whether that class can be
> > used as a parameter to stuff like device_create_drvdata() and
> > sysfs_create_group().
> 
> If you want to see if a class has any devices in it, just do a search
> for any device instead of poking into that field.  Or I can wrap that up
> in the driver core if needed.

That would require taking driver model mutexes before
tasking is working and driver_init() is called.  GPIOs
are regularly used *really* early in board setup ... even
before IRQs are working.

Are driver model searches really expected to work then??

Seems simpler to me to just check "is pointer NULL",
when we know that the pointer is initialized by the
class initialization, and (because the relevant struct
is zero-initialized) null beforehand.  That works more
or less any point during kernel initialization ... not
just after the first task is running.  Plus it's not
as expensive.  :)

- Dave

  reply	other threads:[~2008-07-12  5:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 21:46 [PATCH] gpiolib: Allow user-selection Michael Buesch
2008-07-03  0:04 ` Andrew Morton
2008-07-03  0:26   ` Michael Buesch
2008-07-03  5:00   ` David Brownell
2008-07-03  5:08     ` Andrew Morton
2008-07-03  5:41       ` David Brownell
2008-07-03 19:37         ` Greg KH
2008-07-03 21:28           ` David Brownell
2008-07-03 23:08             ` Greg KH
2008-07-12  5:32               ` David Brownell [this message]
2008-07-03  8:36       ` Rene Herman
2008-07-03  9:01         ` Andrew Morton
2008-07-03 10:19           ` Rene Herman
2008-07-03  8:25   ` David Brownell
2008-07-03  8:42     ` Michael Buesch

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=200807112232.43293.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=sfr@canb.auug.org.au \
    /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