]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: gs_fpgaboot: drop wrapper function 'finish_driver'
authorEva Rachel Retuya <eraretuya@gmail.com>
Wed, 2 Mar 2016 14:23:46 +0000 (22:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Mar 2016 06:09:09 +0000 (22:09 -0800)
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(...);
)
}

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gs_fpgaboot/gs_fpgaboot.c

index fe3a6bc19eed67ad06b797370e84c4caefb198e7..7b7c9786c1621a8ac8ad56d61e5dbd4ffc303cfc 100644 (file)
@@ -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");
 }