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

bus: fsl-mc: Remove deadcode

fsl_mc_allocator_driver_exit() was added explicitly by
commit 1e8ac83b6caf ("bus: fsl-mc: add fsl_mc_allocator cleanup function")
but was never used.

Remove it.

fsl_mc_portal_reset() was added in 2015 by
commit 197f4d6a4a00 ("staging: fsl-mc: fsl-mc object allocator driver")
but was never used.

Remove it.

fsl_mc_portal_reset() was the only caller of dpmcp_reset().

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Acked-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20241115152055.279732-1-linux@treblig.org
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

authored by

Dr. David Alan Gilbert and committed by
Christophe Leroy
c25951eb 586739b1

-55
-22
drivers/bus/fsl-mc/dpmcp.c
··· 75 75 /* send command to mc*/ 76 76 return mc_send_command(mc_io, &cmd); 77 77 } 78 - 79 - /** 80 - * dpmcp_reset() - Reset the DPMCP, returns the object to initial state. 81 - * @mc_io: Pointer to MC portal's I/O object 82 - * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' 83 - * @token: Token of DPMCP object 84 - * 85 - * Return: '0' on Success; Error code otherwise. 86 - */ 87 - int dpmcp_reset(struct fsl_mc_io *mc_io, 88 - u32 cmd_flags, 89 - u16 token) 90 - { 91 - struct fsl_mc_command cmd = { 0 }; 92 - 93 - /* prepare command */ 94 - cmd.header = mc_encode_cmd_header(DPMCP_CMDID_RESET, 95 - cmd_flags, token); 96 - 97 - /* send command to mc*/ 98 - return mc_send_command(mc_io, &cmd); 99 - }
-5
drivers/bus/fsl-mc/fsl-mc-allocator.c
··· 656 656 { 657 657 return fsl_mc_driver_register(&fsl_mc_allocator_driver); 658 658 } 659 - 660 - void fsl_mc_allocator_driver_exit(void) 661 - { 662 - fsl_mc_driver_unregister(&fsl_mc_allocator_driver); 663 - }
-6
drivers/bus/fsl-mc/fsl-mc-private.h
··· 66 66 u32 cmd_flags, 67 67 u16 token); 68 68 69 - int dpmcp_reset(struct fsl_mc_io *mc_io, 70 - u32 cmd_flags, 71 - u16 token); 72 - 73 69 /* 74 70 * Data Path Resource Container (DPRC) API 75 71 */ ··· 626 630 bool alloc_interrupts); 627 631 628 632 int __init fsl_mc_allocator_driver_init(void); 629 - 630 - void fsl_mc_allocator_driver_exit(void); 631 633 632 634 void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev); 633 635
-20
drivers/bus/fsl-mc/mc-io.c
··· 263 263 dpmcp_dev->consumer_link = NULL; 264 264 } 265 265 EXPORT_SYMBOL_GPL(fsl_mc_portal_free); 266 - 267 - /** 268 - * fsl_mc_portal_reset - Resets the dpmcp object for a given fsl_mc_io object 269 - * 270 - * @mc_io: Pointer to the fsl_mc_io object that wraps the MC portal to free 271 - */ 272 - int fsl_mc_portal_reset(struct fsl_mc_io *mc_io) 273 - { 274 - int error; 275 - struct fsl_mc_device *dpmcp_dev = mc_io->dpmcp_dev; 276 - 277 - error = dpmcp_reset(mc_io, 0, dpmcp_dev->mc_handle); 278 - if (error < 0) { 279 - dev_err(&dpmcp_dev->dev, "dpmcp_reset() failed: %d\n", error); 280 - return error; 281 - } 282 - 283 - return 0; 284 - } 285 - EXPORT_SYMBOL_GPL(fsl_mc_portal_reset);
-2
include/linux/fsl/mc.h
··· 417 417 418 418 void fsl_mc_portal_free(struct fsl_mc_io *mc_io); 419 419 420 - int fsl_mc_portal_reset(struct fsl_mc_io *mc_io); 421 - 422 420 int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev, 423 421 enum fsl_mc_pool_type pool_type, 424 422 struct fsl_mc_device **new_mc_adev);