Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6758555da6a171d3f21ce36c0e12a2b8cff7ca9d
Commit:     6758555da6a171d3f21ce36c0e12a2b8cff7ca9d
Parent:     688b3378da9c3485630d4b0356d09bc2e69bb0bd
Author:     David Woodhouse <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 16 07:55:20 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Jun 28 19:16:39 2007 +1000

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Geoff Levand <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/ps3/system-bus.c |   15 +++++++++++++++
 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 633603a..4bb634a 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,
        return 0;
 }
 
+static ssize_t modalias_show(struct device *_dev, struct device_attribute *a,
+       char *buf)
+{
+       struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
+       int len = snprintf(buf, PAGE_SIZE, "ps3:%d\n", dev->match_id);
+
+       return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
+}
+
+static struct device_attribute ps3_system_bus_dev_attrs[] = {
+       __ATTR_RO(modalias),
+       __ATTR_NULL,
+};
+
 struct bus_type ps3_system_bus_type = {
        .name = "ps3_system_bus",
        .match = ps3_system_bus_match,
@@ -459,6 +473,7 @@ struct bus_type ps3_system_bus_type = {
        .probe = ps3_system_bus_probe,
        .remove = ps3_system_bus_remove,
        .shutdown = ps3_system_bus_shutdown,
+       .dev_attrs = ps3_system_bus_dev_attrs,
 };
 
 static int __init ps3_system_bus_init(void)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to