From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: Greg KH <gregkh@suse.de>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: pci: add to global list before sysfs?
Date: Mon, 14 Apr 2008 18:58:36 +1000 [thread overview]
Message-ID: <1208163516.6958.155.camel@pasglop> (raw)
In-Reply-To: <20080414103504.24025b44@mjolnir.drzeus.cx>
On Mon, 2008-04-14 at 10:35 +0200, Pierre Ossman wrote:
> On Mon, 14 Apr 2008 07:37:14 +1000
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> >
> > You don't need a timer. You can just use the notifier mechanism I added
> > a while ago that should call you on device addition and removal on the
> > bus type you are interested in.
> >
>
> Another solution presented itself, but do you have some pointers on
> where I get more information about the notifiers in case I need them
> in the future?
In device.h:
/*
* Bus notifiers: Get notified of addition/removal of devices
* and binding/unbinding of drivers to devices.
* In the long run, it should be a replacement for the platform
* notify hooks.
*/
struct notifier_block;
extern int bus_register_notifier(struct bus_type *bus,
struct notifier_block *nb);
extern int bus_unregister_notifier(struct bus_type *bus,
struct notifier_block *nb);
/* All 4 notifers below get called with the target struct device *
* as an argument. Note that those functions are likely to be called
* with the device semaphore held in the core, so be careful.
*/
#define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */
#define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */
#define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */
#define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be
unbound */
Do you need more info ?
Cheers,
Ben.
next prev parent reply other threads:[~2008-04-14 8:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-04 17:13 pci: add to global list before sysfs? Pierre Ossman
2008-04-04 21:01 ` Greg KH
2008-04-05 9:57 ` Pierre Ossman
2008-04-05 15:53 ` Greg KH
2008-04-05 16:55 ` Pierre Ossman
2008-04-05 17:12 ` Greg KH
2008-04-05 18:27 ` Pierre Ossman
2008-04-08 3:41 ` Greg KH
2008-04-13 12:33 ` Pierre Ossman
2008-04-13 17:51 ` Greg KH
2008-04-13 21:37 ` Benjamin Herrenschmidt
2008-04-14 8:35 ` Pierre Ossman
2008-04-14 8:57 ` Benjamin Herrenschmidt
2008-04-14 8:58 ` Benjamin Herrenschmidt [this message]
2008-04-14 10:58 ` Pierre Ossman
2008-04-13 21:35 ` Benjamin Herrenschmidt
2008-04-15 19:13 ` Greg KH
2008-04-15 21:53 ` Benjamin Herrenschmidt
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=1208163516.6958.155.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=drzeus-list@drzeus.cx \
--cc=gregkh@suse.de \
--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