Author: nwhitehorn
Date: Tue Oct 29 21:08:20 2013
New Revision: 257368
URL: http://svnweb.freebsd.org/changeset/base/257368

Log:
  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

Modified:
  head/sys/powerpc/pseries/plpar_iommu.c

Modified: head/sys/powerpc/pseries/plpar_iommu.c
==============================================================================
--- head/sys/powerpc/pseries/plpar_iommu.c      Tue Oct 29 21:00:54 2013        
(r257367)
+++ head/sys/powerpc/pseries/plpar_iommu.c      Tue Oct 29 21:08:20 2013        
(r257368)
@@ -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, dev
                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);
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to