aboutsummaryrefslogtreecommitdiff
path: root/arch/parisc/kernel
diff options
context:
space:
mode:
authorKyle McMartin <kyle@mako.i.cabal.ca>2007-01-13 14:56:50 -0500
committerKyle McMartin <kyle@athena.road.mcmartin.ca>2007-02-17 01:08:09 -0500
commita04b0605384e019c6fd77cfd4e4ffce8eb50785f (patch)
tree1ee8e08ca875234d2024ff25720e349791cb33f1 /arch/parisc/kernel
parent3fe4c55ebc440159c49efe2e9464ac301b390913 (diff)
[PARISC] display parisc device modalias in sysfs
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc/kernel')
-rw-r--r--arch/parisc/kernel/drivers.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 6274cd268e6..2ca654bd632 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -562,12 +562,23 @@ pa_dev_attr(rev, id.hversion_rev, "0x%x\n");
pa_dev_attr_id(hversion, "0x%03x\n");
pa_dev_attr_id(sversion, "0x%05x\n");
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ struct parisc_device *padev = to_parisc_device(dev);
+ struct parisc_device_id *id = &padev->id;
+
+ return sprintf(buf, "parisc:t%02Xhv%04Xrev%02Xsv%08X\n",
+ (u8)id->hw_type, (u16)id->hversion, (u8)id->hversion_rev,
+ (u32)id->sversion);
+}
+
static struct device_attribute parisc_device_attrs[] = {
__ATTR_RO(irq),
__ATTR_RO(hw_type),
__ATTR_RO(rev),
__ATTR_RO(hversion),
__ATTR_RO(sversion),
+ __ATTR_RO(modalias),
__ATTR_NULL,
};