Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bus: fsl-mc: drop useless cleanup

This cleanup is actually a no-op because the resources are freed when
the device objects are removed from the allocator at driver remove
time. Remove the fsl_mc_cleanup_all_resource_pools() function and its
call site.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20250408105814.2837951-6-ioana.ciornei@nxp.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

authored by

Laurentiu Tudor and committed by
Christophe Leroy
a941bed2 a8c17b9c

-25
-2
drivers/bus/fsl-mc/dprc-driver.c
··· 806 806 dev_set_msi_domain(&mc_dev->dev, NULL); 807 807 } 808 808 809 - fsl_mc_cleanup_all_resource_pools(mc_dev); 810 - 811 809 /* if this step fails we cannot go further with cleanup as there is no way of 812 810 * communicating with the firmware 813 811 */
-21
drivers/bus/fsl-mc/fsl-mc-allocator.c
··· 555 555 } 556 556 } 557 557 558 - static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev, 559 - enum fsl_mc_pool_type pool_type) 560 - { 561 - struct fsl_mc_resource *resource; 562 - struct fsl_mc_resource *next; 563 - struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev); 564 - struct fsl_mc_resource_pool *res_pool = 565 - &mc_bus->resource_pools[pool_type]; 566 - 567 - list_for_each_entry_safe(resource, next, &res_pool->free_list, node) 568 - devm_kfree(&mc_bus_dev->dev, resource); 569 - } 570 - 571 - void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev) 572 - { 573 - int pool_type; 574 - 575 - for (pool_type = 0; pool_type < FSL_MC_NUM_POOL_TYPES; pool_type++) 576 - fsl_mc_cleanup_resource_pool(mc_bus_dev, pool_type); 577 - } 578 - 579 558 /* 580 559 * fsl_mc_allocator_probe - callback invoked when an allocatable device is 581 560 * being added to the system
-2
drivers/bus/fsl-mc/fsl-mc-private.h
··· 629 629 630 630 void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev); 631 631 632 - void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev); 633 - 634 632 int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus, 635 633 enum fsl_mc_pool_type pool_type, 636 634 struct fsl_mc_resource