Skip to content

Commit d4a5c59

Browse files
Christoph Hellwigmcgrof
authored andcommitted
mmc: au1xmmc: force non-modular build and remove symbol_get usage
au1xmmc is split somewhat awkwardly into the main mmc subsystem driver, and callbacks in platform_data that sit under arch/mips/ and are always built in. The latter than call mmc_detect_change through symbol_get. Remove the use of symbol_get by requiring the driver to be built in. In the future the interrupt handlers for card insert/eject detection should probably be moved into the main driver, and which point it can be built modular again. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Manuel Lauss <manuel.lauss@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> [mcgrof: squashed in depends on MMC=y suggested by Arnd] Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent 0faa29c commit d4a5c59

File tree

4 files changed

+7
-35
lines changed

4 files changed

+7
-35
lines changed

arch/mips/alchemy/devboards/db1000.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/interrupt.h>
1515
#include <linux/leds.h>
1616
#include <linux/mmc/host.h>
17-
#include <linux/module.h>
1817
#include <linux/platform_device.h>
1918
#include <linux/pm.h>
2019
#include <linux/spi/spi.h>
@@ -167,12 +166,7 @@ static struct platform_device db1x00_audio_dev = {
167166

168167
static irqreturn_t db1100_mmc_cd(int irq, void *ptr)
169168
{
170-
void (*mmc_cd)(struct mmc_host *, unsigned long);
171-
/* link against CONFIG_MMC=m */
172-
mmc_cd = symbol_get(mmc_detect_change);
173-
mmc_cd(ptr, msecs_to_jiffies(500));
174-
symbol_put(mmc_detect_change);
175-
169+
mmc_detect_change(ptr, msecs_to_jiffies(500));
176170
return IRQ_HANDLED;
177171
}
178172

arch/mips/alchemy/devboards/db1200.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/gpio.h>
1111
#include <linux/i2c.h>
1212
#include <linux/init.h>
13-
#include <linux/module.h>
1413
#include <linux/interrupt.h>
1514
#include <linux/io.h>
1615
#include <linux/leds.h>
@@ -340,14 +339,7 @@ static irqreturn_t db1200_mmc_cd(int irq, void *ptr)
340339

341340
static irqreturn_t db1200_mmc_cdfn(int irq, void *ptr)
342341
{
343-
void (*mmc_cd)(struct mmc_host *, unsigned long);
344-
345-
/* link against CONFIG_MMC=m */
346-
mmc_cd = symbol_get(mmc_detect_change);
347-
if (mmc_cd) {
348-
mmc_cd(ptr, msecs_to_jiffies(200));
349-
symbol_put(mmc_detect_change);
350-
}
342+
mmc_detect_change(ptr, msecs_to_jiffies(200));
351343

352344
msleep(100); /* debounce */
353345
if (irq == DB1200_SD0_INSERT_INT)
@@ -431,14 +423,7 @@ static irqreturn_t pb1200_mmc1_cd(int irq, void *ptr)
431423

432424
static irqreturn_t pb1200_mmc1_cdfn(int irq, void *ptr)
433425
{
434-
void (*mmc_cd)(struct mmc_host *, unsigned long);
435-
436-
/* link against CONFIG_MMC=m */
437-
mmc_cd = symbol_get(mmc_detect_change);
438-
if (mmc_cd) {
439-
mmc_cd(ptr, msecs_to_jiffies(200));
440-
symbol_put(mmc_detect_change);
441-
}
426+
mmc_detect_change(ptr, msecs_to_jiffies(200));
442427

443428
msleep(100); /* debounce */
444429
if (irq == PB1200_SD1_INSERT_INT)

arch/mips/alchemy/devboards/db1300.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <linux/interrupt.h>
1818
#include <linux/ata_platform.h>
1919
#include <linux/mmc/host.h>
20-
#include <linux/module.h>
2120
#include <linux/mtd/mtd.h>
2221
#include <linux/mtd/platnand.h>
2322
#include <linux/platform_device.h>
@@ -459,14 +458,7 @@ static irqreturn_t db1300_mmc_cd(int irq, void *ptr)
459458

460459
static irqreturn_t db1300_mmc_cdfn(int irq, void *ptr)
461460
{
462-
void (*mmc_cd)(struct mmc_host *, unsigned long);
463-
464-
/* link against CONFIG_MMC=m. We can only be called once MMC core has
465-
* initialized the controller, so symbol_get() should always succeed.
466-
*/
467-
mmc_cd = symbol_get(mmc_detect_change);
468-
mmc_cd(ptr, msecs_to_jiffies(200));
469-
symbol_put(mmc_detect_change);
461+
mmc_detect_change(ptr, msecs_to_jiffies(200));
470462

471463
msleep(100); /* debounce */
472464
if (irq == DB1300_SD1_INSERT_INT)

drivers/mmc/host/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,12 @@ config MMC_ALCOR
526526
of Alcor Micro PCI-E card reader
527527

528528
config MMC_AU1X
529-
tristate "Alchemy AU1XX0 MMC Card Interface support"
529+
bool "Alchemy AU1XX0 MMC Card Interface support"
530530
depends on MIPS_ALCHEMY
531+
depends on MMC=y
531532
help
532533
This selects the AMD Alchemy(R) Multimedia card interface.
533-
If you have a Alchemy platform with a MMC slot, say Y or M here.
534+
If you have a Alchemy platform with a MMC slot, say Y here.
534535

535536
If unsure, say N.
536537

0 commit comments

Comments
 (0)