summaryrefslogtreecommitdiff
path: root/drivers/sbus
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-25 22:52:37 -0700
committerDavid S. Miller <davem@davemloft.net>2008-08-29 02:13:12 -0700
commit5778002874de0fb7e3d8c4a0a4afb6b1a6297069 (patch)
tree32855979629bb31ff03051c1f07c70c9a7001a0b /drivers/sbus
parente003934876e75f96f1445565d8c9084c07943253 (diff)
downloadkernel-common-5778002874de0fb7e3d8c4a0a4afb6b1a6297069.tar.gz
kernel-common-5778002874de0fb7e3d8c4a0a4afb6b1a6297069.tar.bz2
kernel-common-5778002874de0fb7e3d8c4a0a4afb6b1a6297069.zip
sparc: Propagate SBUS iommu archdata into real of_device objects.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus')
-rw-r--r--drivers/sbus/sbus.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c
index 69491625d869..db0766e5c7d1 100644
--- a/drivers/sbus/sbus.c
+++ b/drivers/sbus/sbus.c
@@ -30,6 +30,24 @@ static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, show_sbusobppath_attr,
struct sbus_bus *sbus_root;
+static void __init fill_sbus_device_iommu(struct sbus_dev *sdev)
+{
+ struct of_device *op = of_find_device_by_node(sdev->ofdev.node);
+ struct dev_archdata *sd, *bus_sd;
+ struct sbus_bus *sbus;
+
+ sbus = sdev->bus;
+ bus_sd = &sbus->ofdev.dev.archdata;
+
+ sd = &sdev->ofdev.dev.archdata;
+ sd->iommu = bus_sd->iommu;
+ sd->stc = bus_sd->stc;
+
+ sd = &op->dev.archdata;
+ sd->iommu = bus_sd->iommu;
+ sd->stc = bus_sd->stc;
+}
+
static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev)
{
struct dev_archdata *sd;
@@ -85,6 +103,8 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde
/* WE HAVE BEEN INVADED BY ALIENS! */
err = sysfs_create_file(&sdev->ofdev.dev.kobj, &dev_attr_obppath.attr);
+
+ fill_sbus_device_iommu(sdev);
}
static void __init sbus_bus_ranges_init(struct device_node *dp, struct sbus_bus *sbus)
@@ -209,10 +229,6 @@ static void __init walk_children(struct device_node *dp, struct sbus_dev *parent
sdev->bus = sbus;
sdev->parent = parent;
- sdev->ofdev.dev.archdata.iommu =
- sbus->ofdev.dev.archdata.iommu;
- sdev->ofdev.dev.archdata.stc =
- sbus->ofdev.dev.archdata.stc;
fill_sbus_device(dp, sdev);