aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/sbus.c
diff options
context:
space:
mode:
authorFabio Massimo Di Nitto <fabbione@ubuntu.com>2006-12-20 12:22:28 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-11 02:50:35 -0500
commitcf69eab231bb748b5c34912412a8fc8c763bcf57 (patch)
tree4e1a080b7d33765d9ec62ead60bc3c9004a961a3 /drivers/sbus/sbus.c
parentd18d7682c18b617f523df6beea5ea0bd396ed0bd (diff)
[SPARC64]: Add obppath sysfs attribute for SBUS and PCI devices.
Signed-off-by: Fabio Massimo Di Nitto <fabbione@ubuntu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus/sbus.c')
-rw-r--r--drivers/sbus/sbus.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c
index 98fcbb3d5560..6349dd617f85 100644
--- a/drivers/sbus/sbus.c
+++ b/drivers/sbus/sbus.c
@@ -7,6 +7,7 @@
7#include <linux/slab.h> 7#include <linux/slab.h>
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/pci.h> 9#include <linux/pci.h>
10#include <linux/device.h>
10 11
11#include <asm/system.h> 12#include <asm/system.h>
12#include <asm/sbus.h> 13#include <asm/sbus.h>
@@ -17,13 +18,25 @@
17#include <asm/bpp.h> 18#include <asm/bpp.h>
18#include <asm/irq.h> 19#include <asm/irq.h>
19 20
21static ssize_t
22show_sbusobppath_attr(struct device * dev, struct device_attribute * attr, char * buf)
23{
24 struct sbus_dev *sbus;
25
26 sbus = to_sbus_device(dev);
27
28 return snprintf (buf, PAGE_SIZE, "%s\n", sbus->ofdev.node->full_name);
29}
30
31static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_sbusobppath_attr, NULL);
32
20struct sbus_bus *sbus_root; 33struct sbus_bus *sbus_root;
21 34
22static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev) 35static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev)
23{ 36{
24 unsigned long base; 37 unsigned long base;
25 void *pval; 38 void *pval;
26 int len; 39 int len, err;
27 40
28 sdev->prom_node = dp->node; 41 sdev->prom_node = dp->node;
29 strcpy(sdev->prom_name, dp->name); 42 strcpy(sdev->prom_name, dp->name);
@@ -66,6 +79,9 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde
66 if (of_device_register(&sdev->ofdev) != 0) 79 if (of_device_register(&sdev->ofdev) != 0)
67 printk(KERN_DEBUG "sbus: device registration error for %s!\n", 80 printk(KERN_DEBUG "sbus: device registration error for %s!\n",
68 dp->path_component_name); 81 dp->path_component_name);
82
83 /* WE HAVE BEEN INVADED BY ALIENS! */
84 err = sysfs_create_file(&sdev->ofdev.dev.kobj, &dev_attr_obppath.attr);
69} 85}
70 86
71static void __init sbus_bus_ranges_init(struct device_node *dp, struct sbus_bus *sbus) 87static void __init sbus_bus_ranges_init(struct device_node *dp, struct sbus_bus *sbus)