/** * omap_device_count_resources - count number of struct resource entries needed * @od: struct omap_device * * * Count the number of struct resource entries needed for this * omap_device @od. Used by omap_device_build_ss() to determine how * much memory to allocate before calling * omap_device_fill_resources(). Returns the count. */ int omap_device_count_resources(struct omap_device *od) { int c = 0; int i; for (i = 0; i < od->hwmods_cnt; i++) c += omap_hwmod_count_resources(od->hwmods[i]); pr_debug("omap_device: %s: counted %d total resources across %d " "hwmods\n", od->pdev.name, c, od->hwmods_cnt); return c; }
/** * omap_device_count_resources - count number of struct resource entries needed * @od: struct omap_device * * @flags: Type of resources to include when counting (IRQ/DMA/MEM) * * Count the number of struct resource entries needed for this * omap_device @od. Used by omap_device_build_ss() to determine how * much memory to allocate before calling * omap_device_fill_resources(). Returns the count. */ static int omap_device_count_resources(struct omap_device *od, unsigned long flags) { int c = 0; int i; for (i = 0; i < od->hwmods_cnt; i++) c += omap_hwmod_count_resources(od->hwmods[i], flags); pr_debug("omap_device: %s: counted %d total resources across %d hwmods\n", od->pdev->name, c, od->hwmods_cnt); return c; }