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

cdx: controller: Do not open-code module_platform_driver()

Replace standard platform_driver_register() boilerplate with
module_platform_driver() to make code smaller.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Nikhil Agarwal <nikhil.agarwal@amd.com>
Link: https://lore.kernel.org/r/20250502-cdx-clean-v3-4-6aaa5b369fc5@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Krzysztof Kozlowski and committed by
Greg Kroah-Hartman
a46da20b cfe78d4a

+1 -18
+1 -18
drivers/cdx/controller/cdx_controller.c
··· 250 250 .remove = xlnx_cdx_remove, 251 251 }; 252 252 253 - static int __init cdx_controller_init(void) 254 - { 255 - int ret; 256 - 257 - ret = platform_driver_register(&cdx_pdriver); 258 - if (ret) 259 - pr_err("platform_driver_register() failed: %d\n", ret); 260 - 261 - return ret; 262 - } 263 - 264 - static void __exit cdx_controller_exit(void) 265 - { 266 - platform_driver_unregister(&cdx_pdriver); 267 - } 268 - 269 - module_init(cdx_controller_init); 270 - module_exit(cdx_controller_exit); 253 + module_platform_driver(cdx_pdriver); 271 254 272 255 MODULE_AUTHOR("AMD Inc."); 273 256 MODULE_DESCRIPTION("CDX controller for AMD devices");