]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bus: fsl-mc: drop useless cleanup
authorLaurentiu Tudor <laurentiu.tudor@nxp.com>
Tue, 8 Apr 2025 10:58:13 +0000 (13:58 +0300)
committerChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 12 May 2025 23:34:57 +0000 (01:34 +0200)
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>
drivers/bus/fsl-mc/dprc-driver.c
drivers/bus/fsl-mc/fsl-mc-allocator.c
drivers/bus/fsl-mc/fsl-mc-private.h

index 52053f7c6d9a654ba46c6579c6a3c5c3faaa75c1..c63a7e688db6a33abc72befb93dd24fd7db8aaea 100644 (file)
@@ -806,8 +806,6 @@ int dprc_cleanup(struct fsl_mc_device *mc_dev)
                dev_set_msi_domain(&mc_dev->dev, NULL);
        }
 
-       fsl_mc_cleanup_all_resource_pools(mc_dev);
-
        /* if this step fails we cannot go further with cleanup as there is no way of
         * communicating with the firmware
         */
index 6c3beb82dd1b73c6f104155d37cf9d77f6e749fa..d2ea59471323af482c823443d7655f71988e0a1e 100644 (file)
@@ -555,27 +555,6 @@ void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
        }
 }
 
-static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev,
-                                        enum fsl_mc_pool_type pool_type)
-{
-       struct fsl_mc_resource *resource;
-       struct fsl_mc_resource *next;
-       struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
-       struct fsl_mc_resource_pool *res_pool =
-                                       &mc_bus->resource_pools[pool_type];
-
-       list_for_each_entry_safe(resource, next, &res_pool->free_list, node)
-               devm_kfree(&mc_bus_dev->dev, resource);
-}
-
-void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
-{
-       int pool_type;
-
-       for (pool_type = 0; pool_type < FSL_MC_NUM_POOL_TYPES; pool_type++)
-               fsl_mc_cleanup_resource_pool(mc_bus_dev, pool_type);
-}
-
 /*
  * fsl_mc_allocator_probe - callback invoked when an allocatable device is
  * being added to the system
index e1b7ec3ed1a73b0f2d7f75c169ef83069e59df27..beed4c53533d8132f6f823dec601bbf2085751f3 100644 (file)
@@ -629,8 +629,6 @@ int __init fsl_mc_allocator_driver_init(void);
 
 void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev);
 
-void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev);
-
 int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus,
                                          enum fsl_mc_pool_type pool_type,
                                          struct fsl_mc_resource