aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/ps3
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-06-15 17:55:20 -0400
committerPaul Mackerras <paulus@samba.org>2007-06-28 05:16:39 -0400
commit6758555da6a171d3f21ce36c0e12a2b8cff7ca9d (patch)
tree091d52a52ad420c0c05100b0172cbd1b505ff709 /arch/powerpc/platforms/ps3
parent688b3378da9c3485630d4b0356d09bc2e69bb0bd (diff)
[POWERPC] PS3: System-bus modinfo attribute
Add modinfo attribute to ps3_system_bus devices. Also make them all children of the same ps3_system_bus 'device' so they appear in a corresponding subdirectory under /sys/devices. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/ps3')
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 633603a53819..4bb634a17e43 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -452,6 +452,20 @@ static int ps3_system_bus_uevent(struct device *_dev, char **envp,
452 return 0; 452 return 0;
453} 453}
454 454
455static ssize_t modalias_show(struct device *_dev, struct device_attribute *a,
456 char *buf)
457{
458 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
459 int len = snprintf(buf, PAGE_SIZE, "ps3:%d\n", dev->match_id);
460
461 return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
462}
463
464static struct device_attribute ps3_system_bus_dev_attrs[] = {
465 __ATTR_RO(modalias),
466 __ATTR_NULL,
467};
468
455struct bus_type ps3_system_bus_type = { 469struct bus_type ps3_system_bus_type = {
456 .name = "ps3_system_bus", 470 .name = "ps3_system_bus",
457 .match = ps3_system_bus_match, 471 .match = ps3_system_bus_match,
@@ -459,6 +473,7 @@ struct bus_type ps3_system_bus_type = {
459 .probe = ps3_system_bus_probe, 473 .probe = ps3_system_bus_probe,
460 .remove = ps3_system_bus_remove, 474 .remove = ps3_system_bus_remove,
461 .shutdown = ps3_system_bus_shutdown, 475 .shutdown = ps3_system_bus_shutdown,
476 .dev_attrs = ps3_system_bus_dev_attrs,
462}; 477};
463 478
464static int __init ps3_system_bus_init(void) 479static int __init ps3_system_bus_init(void)