]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc: atmel-mci: fix mismatched section on atmci_cleanup_slot
authorArnd Bergmann <arnd@arndb.de>
Fri, 26 Sep 2014 19:34:58 +0000 (21:34 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Sep 2014 09:27:32 +0000 (11:27 +0200)
As of 528bc7808f4e ("mmc: atmel-mci: Release mmc resources on failure in probe"),
the atmci_probe() function calls atmci_cleanup_slot in the failure path.

This causes a new warning whenever the driver is built:

WARNING: drivers/mmc/host/built-in.o(.init.text+0xa04): Section mismatch in reference from the function atmci_probe() to the function .exit.text:atmci_cleanup_slot()
The function __init atmci_probe() references
a function __exit atmci_cleanup_slot().

Gcc correctly warns about this function getting dropped in the link stage
for the built-in case, which would cause undefined behavior when this error
path is hit. The solution is to simply drop the __exit annotation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 528bc7808f4e ("mmc: atmel-mci: Release mmc resources on failure in probe")
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/atmel-mci.c

index 772ef5b0e4d52250d62306d832dce3f7af856660..77250d4b197923124f9389b811623ea3a6359c28 100644 (file)
@@ -2244,7 +2244,7 @@ static int __init atmci_init_slot(struct atmel_mci *host,
        return 0;
 }
 
-static void __exit atmci_cleanup_slot(struct atmel_mci_slot *slot,
+static void atmci_cleanup_slot(struct atmel_mci_slot *slot,
                unsigned int id)
 {
        /* Debugfs stuff is cleaned up by mmc core */