diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-10-29 21:08:20 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-10-29 21:08:20 +0000 |
commit | 352d20048f7d02f05ec6f2cbf3899f1227c30b0b (patch) | |
tree | f5b637557abfdf28dc2f9984fd90f6314dfc74a2 /sys/powerpc/pseries | |
parent | b782e38fec87b1049fbbe23bec12f57438d79dc0 (diff) | |
download | FreeBSD-src-352d20048f7d02f05ec6f2cbf3899f1227c30b0b.zip FreeBSD-src-352d20048f7d02f05ec6f2cbf3899f1227c30b0b.tar.gz |
The ofw_bus() routines invoke the device's parent, not the device itself,
so cease iterating when the parent is NULL, not when the device is.
MFC after: 5 days
Diffstat (limited to 'sys/powerpc/pseries')
-rw-r--r-- | sys/powerpc/pseries/plpar_iommu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/powerpc/pseries/plpar_iommu.c b/sys/powerpc/pseries/plpar_iommu.c index 3b67a38..84a9054 100644 --- a/sys/powerpc/pseries/plpar_iommu.c +++ b/sys/powerpc/pseries/plpar_iommu.c @@ -69,14 +69,14 @@ struct dma_window { }; int -phyp_iommu_set_dma_tag(device_t dev, device_t child, bus_dma_tag_t tag) +phyp_iommu_set_dma_tag(device_t bus, device_t dev, bus_dma_tag_t tag) { device_t p; phandle_t node; cell_t dma_acells, dma_scells, dmawindow[5]; struct iommu_map *i; - for (p = child; p != NULL; p = device_get_parent(p)) { + for (p = dev; device_get_parent(p) != NULL; p = device_get_parent(p)) { if (ofw_bus_has_prop(p, "ibm,my-dma-window")) break; if (ofw_bus_has_prop(p, "ibm,dma-window")) @@ -145,7 +145,7 @@ phyp_iommu_set_dma_tag(device_t dev, device_t child, bus_dma_tag_t tag) papr_supports_stuff_tce = !(phyp_hcall(H_STUFF_TCE, window->map->iobn, 0, 0, 0) == H_FUNCTION); - bus_dma_tag_set_iommu(tag, dev, window); + bus_dma_tag_set_iommu(tag, bus, window); return (0); } |