Author: br
Date: Fri May 15 13:55:18 2015
New Revision: 282972
URL: https://svnweb.freebsd.org/changeset/base/282972

Log:
  Provide the number of interrupt resources added to the list
  by using extra argument, so caller will know that.

Modified:
  head/sys/dev/fdt/simplebus.c
  head/sys/dev/gpio/ofw_gpiobus.c
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_bus_subr.h
  head/sys/dev/ofw/ofw_iicbus.c
  head/sys/mips/beri/beri_simplebus.c
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/powerpc/pseries/vdevice.c

Modified: head/sys/dev/fdt/simplebus.c
==============================================================================
--- head/sys/dev/fdt/simplebus.c        Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/dev/fdt/simplebus.c        Fri May 15 13:55:18 2015        
(r282972)
@@ -251,7 +251,7 @@ simplebus_setup_dinfo(device_t dev, phan
 
        resource_list_init(&ndi->rl);
        ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &ndi->rl);
-       ofw_bus_intr_to_rl(dev, node, &ndi->rl);
+       ofw_bus_intr_to_rl(dev, node, &ndi->rl, NULL);
 
        return (ndi);
 }

Modified: head/sys/dev/gpio/ofw_gpiobus.c
==============================================================================
--- head/sys/dev/gpio/ofw_gpiobus.c     Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/dev/gpio/ofw_gpiobus.c     Fri May 15 13:55:18 2015        
(r282972)
@@ -147,7 +147,7 @@ ofw_gpiobus_setup_devinfo(device_t bus, 
        }
        free(pins, M_DEVBUF);
        /* Parse the interrupt resources. */
-       if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl) != 0) {
+       if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) {
                ofw_gpiobus_destroy_devinfo(bus, dinfo);
                return (NULL);
        }

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c     Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/dev/ofw/ofw_bus_subr.c     Fri May 15 13:55:18 2015        
(r282972)
@@ -430,7 +430,8 @@ ofw_bus_reg_to_rl(device_t dev, phandle_
 }
 
 int
-ofw_bus_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl)
+ofw_bus_intr_to_rl(device_t dev, phandle_t node,
+    struct resource_list *rl, int *rlen)
 {
        phandle_t iparent;
        uint32_t icells, *intr;
@@ -495,6 +496,8 @@ ofw_bus_intr_to_rl(device_t dev, phandle
                irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]);
                resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1);
        }
+       if (rlen != NULL)
+               *rlen = rid;
        free(intr, M_OFWPROP);
        return (err);
 }

Modified: head/sys/dev/ofw/ofw_bus_subr.h
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.h     Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/dev/ofw/ofw_bus_subr.h     Fri May 15 13:55:18 2015        
(r282972)
@@ -75,7 +75,7 @@ int   ofw_bus_search_intrmap(void *, int, 
 /* Routines for parsing device-tree data into resource lists. */
 int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t,
     struct resource_list *);
-int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *);
+int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *, int *);
 
 /* Helper to get device status property */
 const char *ofw_bus_get_status(device_t dev);

Modified: head/sys/dev/ofw/ofw_iicbus.c
==============================================================================
--- head/sys/dev/ofw/ofw_iicbus.c       Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/dev/ofw/ofw_iicbus.c       Fri May 15 13:55:18 2015        
(r282972)
@@ -156,7 +156,8 @@ ofw_iicbus_attach(device_t dev)
 
                childdev = device_add_child(dev, NULL, -1);
                resource_list_init(&dinfo->opd_dinfo.rl);
-               ofw_bus_intr_to_rl(childdev, child, &dinfo->opd_dinfo.rl);
+               ofw_bus_intr_to_rl(childdev, child,
+                                       &dinfo->opd_dinfo.rl, NULL);
                device_set_ivars(childdev, dinfo);
        }
 

Modified: head/sys/mips/beri/beri_simplebus.c
==============================================================================
--- head/sys/mips/beri/beri_simplebus.c Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/mips/beri/beri_simplebus.c Fri May 15 13:55:18 2015        
(r282972)
@@ -198,7 +198,7 @@ simplebus_attach(device_t dev)
                        continue;
                }
 
-               if (ofw_bus_intr_to_rl(dev, dt_child, &di->di_res)) {
+               if (ofw_bus_intr_to_rl(dev, dt_child, &di->di_res, NULL)) {
                        device_printf(dev, "%s: could not process "
                            "'interrupts' property\n", di->di_ofw.obd_name);
                        resource_list_free(&di->di_res);

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_pcibus.c   Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/powerpc/ofw/ofw_pcibus.c   Fri May 15 13:55:18 2015        
(r282972)
@@ -201,7 +201,8 @@ ofw_pcibus_enum_devtree(device_t dev, u_
                 * resource list.
                 */
                if (dinfo->opd_dinfo.cfg.intpin == 0)
-                       ofw_bus_intr_to_rl(dev, child, 
&dinfo->opd_dinfo.resources);
+                       ofw_bus_intr_to_rl(dev, child,
+                               &dinfo->opd_dinfo.resources, NULL);
        }
 }
 

Modified: head/sys/powerpc/pseries/vdevice.c
==============================================================================
--- head/sys/powerpc/pseries/vdevice.c  Fri May 15 13:50:37 2015        
(r282971)
+++ head/sys/powerpc/pseries/vdevice.c  Fri May 15 13:55:18 2015        
(r282972)
@@ -146,7 +146,7 @@ vdevice_attach(device_t dev) 
                 }
                resource_list_init(&dinfo->mdi_resources);
 
-               ofw_bus_intr_to_rl(dev, child, &dinfo->mdi_resources);
+               ofw_bus_intr_to_rl(dev, child, &dinfo->mdi_resources, NULL);
 
                 cdev = device_add_child(dev, NULL, -1);
                 if (cdev == NULL) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to