From: Sylvain Munaut <tnt@246tNt.com>
To: Paul Mackerras <paulus@samba.org>
Cc: Sylvain Munaut <tnt@246tNt.com>, Arnd Bergmann <arnd@arndb.de>,
Linux PPC Devel <linuxppc-dev@ozlabs.org>
Subject: [PATCH 3/4] powerpc: Add uevent handler for of_platform_bus
Date: Mon, 18 Dec 2006 23:46:38 +0100 [thread overview]
Message-ID: <11664820013460-git-send-email-tnt@246tNt.com> (raw)
In-Reply-To: <11664820003098-git-send-email-tnt@246tNt.com>
Adding this handler allow userspace to properly handle the module
autoloading. The generation of the uevent itself is now common to
all bus using of_device, so not much code here.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
---
arch/powerpc/kernel/of_platform.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 3002ea3..ce40dd5 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -73,6 +73,18 @@ static int of_platform_bus_match(struct
return of_match_device(matches, of_dev) != NULL;
}
+static int of_platform_device_uevent(struct device *dev,
+ char **envp, int num_envp, char *buffer, int buffer_size)
+{
+ struct of_device *of;
+
+ if (!dev)
+ return -ENODEV;
+
+ of = to_of_device(dev);
+ return of_device_uevent(of, envp, num_envp, buffer, buffer_size);
+}
+
static int of_platform_device_probe(struct device *dev)
{
int error = -ENODEV;
@@ -132,6 +144,7 @@ static int of_platform_device_resume(str
struct bus_type of_platform_bus_type = {
.name = "of_platform",
.match = of_platform_bus_match,
+ .uevent = of_platform_device_uevent,
.probe = of_platform_device_probe,
.remove = of_platform_device_remove,
.suspend = of_platform_device_suspend,
--
1.4.2
next prev parent reply other threads:[~2006-12-18 22:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-18 22:46 [PATCH 0/3] uevents handler for macio & of_platform Sylvain Munaut
2006-12-18 22:46 ` [PATCH 1/4] powerpc: Add a unified uevent handler for bus based on of_device Sylvain Munaut
2006-12-18 22:46 ` [PATCH 2/4] macintosh: Use the new of_device common uevent handler Sylvain Munaut
2006-12-18 22:46 ` Sylvain Munaut [this message]
2006-12-18 22:46 ` [PATCH 4/4] powerpc: Add uevent handler for ibmebus Sylvain Munaut
2006-12-18 23:03 ` Arnd Bergmann
2006-12-18 23:09 ` Sylvain Munaut
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=11664820013460-git-send-email-tnt@246tNt.com \
--to=tnt@246tnt.com \
--cc=arnd@arndb.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).