Skip to contentSkip to conversation

staging: gs_fpgaboot: drop wrapper function 'finish_driver'

PATCH New Eva Rachel Retuya 1 participant 1 message Mar 2, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: gs_fpgaboot: drop wrapper function 'finish_driver'

Remove the function 'finish_driver' since a direct call to platform_device_unregister() is intuitive enough to signify the original intention of the function being removed. Coccinelle semantic patch used to detect this:

@@
identifier wrapper, func;
type T;
@@

*T wrapper(...)
{
(

	return func(...);
|
	func(...);

)
}

---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/staging/gs_fpgaboot/gs_fpgaboot.c +2 -7
index fe3a6bc..7b7c978 100644
@@ -281,11 +281,6 @@ static int init_driver(void)
 	return PTR_ERR_OR_ZERO(firmware_pdev);
 }
 
-static void finish_driver(void)
-{
-	platform_device_unregister(firmware_pdev);
-}
-
 static int gs_fpgaboot(void)
 {
 	int err;
@@ -370,14 +365,14 @@ static int __init gs_fpgaboot_init(void)
 	return 0;
 
 errout:
-	finish_driver();
+	platform_device_unregister(firmware_pdev);
 
 	return err;
 }
 
 static void __exit gs_fpgaboot_exit(void)
 {
-	finish_driver();
+	platform_device_unregister(firmware_pdev);
 	pr_info("FPGA image download module removed\n");
 }
 
Signature · 1 line
1.9.1