/** * omap_device_fill_resources - fill in array of struct resource * @od: struct omap_device * * @res: pointer to an array of struct resource to be filled in * * Populate one or more empty struct resource pointed to by @res with * the resource data for this omap_device @od. Used by * omap_device_build_ss() after calling omap_device_count_resources(). * Ideally this function would not be needed at all. If omap_device * replaces platform_device, then we can specify our own * get_resource()/ get_irq()/etc functions that use the underlying * omap_hwmod information. Or if platform_device is extended to use * subarchitecture-specific function pointers, the various * platform_device functions can simply call omap_device internal * functions to get device resources. Hacking around the existing * platform_device code wastes memory. Returns 0. */ int omap_device_fill_resources(struct omap_device *od, struct resource *res) { int c = 0; int i, r; for (i = 0; i < od->hwmods_cnt; i++) { r = omap_hwmod_fill_resources(od->hwmods[i], res); res += r; c += r; } return 0; }
/** * omap_device_fill_resources - fill in array of struct resource * @od: struct omap_device * * @res: pointer to an array of struct resource to be filled in * * Populate one or more empty struct resource pointed to by @res with * the resource data for this omap_device @od. Used by * omap_device_build_ss() after calling omap_device_count_resources(). * Ideally this function would not be needed at all. If omap_device * replaces platform_device, then we can specify our own * get_resource()/ get_irq()/etc functions that use the underlying * omap_hwmod information. Or if platform_device is extended to use * subarchitecture-specific function pointers, the various * platform_device functions can simply call omap_device internal * functions to get device resources. Hacking around the existing * platform_device code wastes memory. Returns 0. */ int omap_device_fill_resources(struct omap_device *od, struct resource *res) { struct omap_hwmod *oh; int c = 0; int i, r; for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) { r = omap_hwmod_fill_resources(oh, res); res += r; c += r; } return 0; }