From: Olaf Hering <olaf@aepfle.de>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] create modalias file in sysfs for bus vio
Date: Tue, 22 Jan 2008 09:33:28 +0100 [thread overview]
Message-ID: <20080122083328.GA11928@aepfle.de> (raw)
Create /sys/bus/vio/devices/*/modalias file to allow autoloading
of modules. modalias files are already present for many other bus types.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
arch/powerpc/kernel/vio.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -296,9 +296,24 @@ static ssize_t devspec_show(struct devic
return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
}
+static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct device_node *of_node = dev->archdata.of_node;
+ const char *compat;
+ int i = 0;
+
+ if (of_node) {
+ compat = of_get_property(of_node, "compatible", &i);
+ i = sprintf (buf, "vio:T%sS%s\n", of_node->type, compat ? compat : "");
+ }
+ return i;
+}
+
static struct device_attribute vio_dev_attrs[] = {
__ATTR_RO(name),
__ATTR_RO(devspec),
+ __ATTR_RO(modalias),
__ATTR_NULL
};
next reply other threads:[~2008-01-22 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-22 8:33 Olaf Hering [this message]
2008-01-22 14:05 ` [PATCH] create modalias file in sysfs for bus vio Stephen Rothwell
2008-01-25 17:09 ` Olaf Hering
2008-02-04 6:39 ` Stephen Rothwell
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=20080122083328.GA11928@aepfle.de \
--to=olaf@aepfle.de \
--cc=linuxppc-dev@ozlabs.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).