diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-26 01:52:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-29 05:13:12 -0400 |
commit | 5778002874de0fb7e3d8c4a0a4afb6b1a6297069 (patch) | |
tree | 32855979629bb31ff03051c1f07c70c9a7001a0b /drivers | |
parent | e003934876e75f96f1445565d8c9084c07943253 (diff) |
sparc: Propagate SBUS iommu archdata into real of_device objects.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/sbus/sbus.c | 24 |
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, | |||
30 | 30 | ||
31 | struct sbus_bus *sbus_root; | 31 | struct sbus_bus *sbus_root; |
32 | 32 | ||
33 | static void __init fill_sbus_device_iommu(struct sbus_dev *sdev) | ||
34 | { | ||
35 | struct of_device *op = of_find_device_by_node(sdev->ofdev.node); | ||
36 | struct dev_archdata *sd, *bus_sd; | ||
37 | struct sbus_bus *sbus; | ||
38 | |||
39 | sbus = sdev->bus; | ||
40 | bus_sd = &sbus->ofdev.dev.archdata; | ||
41 | |||
42 | sd = &sdev->ofdev.dev.archdata; | ||
43 | sd->iommu = bus_sd->iommu; | ||
44 | sd->stc = bus_sd->stc; | ||
45 | |||
46 | sd = &op->dev.archdata; | ||
47 | sd->iommu = bus_sd->iommu; | ||
48 | sd->stc = bus_sd->stc; | ||
49 | } | ||
50 | |||
33 | static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev) | 51 | static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev) |
34 | { | 52 | { |
35 | struct dev_archdata *sd; | 53 | struct dev_archdata *sd; |
@@ -85,6 +103,8 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde | |||
85 | 103 | ||
86 | /* WE HAVE BEEN INVADED BY ALIENS! */ | 104 | /* WE HAVE BEEN INVADED BY ALIENS! */ |
87 | err = sysfs_create_file(&sdev->ofdev.dev.kobj, &dev_attr_obppath.attr); | 105 | err = sysfs_create_file(&sdev->ofdev.dev.kobj, &dev_attr_obppath.attr); |
106 | |||
107 | fill_sbus_device_iommu(sdev); | ||
88 | } | 108 | } |
89 | 109 | ||
90 | static void __init sbus_bus_ranges_init(struct device_node *dp, struct sbus_bus *sbus) | 110 | 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 | |||
209 | 229 | ||
210 | sdev->bus = sbus; | 230 | sdev->bus = sbus; |
211 | sdev->parent = parent; | 231 | sdev->parent = parent; |
212 | sdev->ofdev.dev.archdata.iommu = | ||
213 | sbus->ofdev.dev.archdata.iommu; | ||
214 | sdev->ofdev.dev.archdata.stc = | ||
215 | sbus->ofdev.dev.archdata.stc; | ||
216 | 232 | ||
217 | fill_sbus_device(dp, sdev); | 233 | fill_sbus_device(dp, sdev); |
218 | 234 | ||