diff options
Diffstat (limited to 'drivers/parisc')
-rw-r--r-- | drivers/parisc/gsc.c | 11 | ||||
-rw-r--r-- | drivers/parisc/sba_iommu.c | 18 |
2 files changed, 24 insertions, 5 deletions
diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c index af5e02526a18..16d40f95978d 100644 --- a/drivers/parisc/gsc.c +++ b/drivers/parisc/gsc.c | |||
@@ -183,12 +183,20 @@ void gsc_asic_assign_irq(struct gsc_asic *asic, int local_irq, int *irqp) | |||
183 | *irqp = irq; | 183 | *irqp = irq; |
184 | } | 184 | } |
185 | 185 | ||
186 | static struct device *next_device(struct klist_iter *i) | ||
187 | { | ||
188 | struct klist_node * n = klist_next(i); | ||
189 | return n ? container_of(n, struct device, knode_parent) : NULL; | ||
190 | } | ||
191 | |||
186 | void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl, | 192 | void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl, |
187 | void (*choose_irq)(struct parisc_device *, void *)) | 193 | void (*choose_irq)(struct parisc_device *, void *)) |
188 | { | 194 | { |
189 | struct device *dev; | 195 | struct device *dev; |
196 | struct klist_iter i; | ||
190 | 197 | ||
191 | list_for_each_entry(dev, &parent->dev.children, node) { | 198 | klist_iter_init(&parent->dev.klist_children, &i); |
199 | while ((dev = next_device(&i))) { | ||
192 | struct parisc_device *padev = to_parisc_device(dev); | 200 | struct parisc_device *padev = to_parisc_device(dev); |
193 | 201 | ||
194 | /* work-around for 715/64 and others which have parent | 202 | /* work-around for 715/64 and others which have parent |
@@ -197,6 +205,7 @@ void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl, | |||
197 | return gsc_fixup_irqs(padev, ctrl, choose_irq); | 205 | return gsc_fixup_irqs(padev, ctrl, choose_irq); |
198 | choose_irq(padev, ctrl); | 206 | choose_irq(padev, ctrl); |
199 | } | 207 | } |
208 | klist_iter_exit(&i); | ||
200 | } | 209 | } |
201 | 210 | ||
202 | int gsc_common_setup(struct parisc_device *parent, struct gsc_asic *gsc_asic) | 211 | int gsc_common_setup(struct parisc_device *parent, struct gsc_asic *gsc_asic) |
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 82ea68b55df4..a8405f05fb5f 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -1322,19 +1322,29 @@ sba_alloc_pdir(unsigned int pdir_size) | |||
1322 | return (void *) pdir_base; | 1322 | return (void *) pdir_base; |
1323 | } | 1323 | } |
1324 | 1324 | ||
1325 | static struct device *next_device(struct klist_iter *i) | ||
1326 | { | ||
1327 | struct klist_node * n = klist_next(i); | ||
1328 | return n ? container_of(n, struct device, knode_parent) : NULL; | ||
1329 | } | ||
1330 | |||
1325 | /* setup Mercury or Elroy IBASE/IMASK registers. */ | 1331 | /* setup Mercury or Elroy IBASE/IMASK registers. */ |
1326 | static void setup_ibase_imask(struct parisc_device *sba, struct ioc *ioc, int ioc_num) | 1332 | static void |
1333 | setup_ibase_imask(struct parisc_device *sba, struct ioc *ioc, int ioc_num) | ||
1327 | { | 1334 | { |
1328 | /* lba_set_iregs() is in drivers/parisc/lba_pci.c */ | 1335 | /* lba_set_iregs() is in drivers/parisc/lba_pci.c */ |
1329 | extern void lba_set_iregs(struct parisc_device *, u32, u32); | 1336 | extern void lba_set_iregs(struct parisc_device *, u32, u32); |
1330 | struct device *dev; | 1337 | struct device *dev; |
1338 | struct klist_iter i; | ||
1331 | 1339 | ||
1332 | list_for_each_entry(dev, &sba->dev.children, node) { | 1340 | klist_iter_init(&sba->dev.klist_children, &i); |
1341 | while ((dev = next_device(&i))) { | ||
1333 | struct parisc_device *lba = to_parisc_device(dev); | 1342 | struct parisc_device *lba = to_parisc_device(dev); |
1334 | int rope_num = (lba->hpa >> 13) & 0xf; | 1343 | int rope_num = (lba->hpa.start >> 13) & 0xf; |
1335 | if (rope_num >> 3 == ioc_num) | 1344 | if (rope_num >> 3 == ioc_num) |
1336 | lba_set_iregs(lba, ioc->ibase, ioc->imask); | 1345 | lba_set_iregs(lba, ioc->ibase, ioc->imask); |
1337 | } | 1346 | } |
1347 | klist_iter_exit(&i); | ||
1338 | } | 1348 | } |
1339 | 1349 | ||
1340 | static void | 1350 | static void |