From 4e5b50116d60c5136bee585af21791efb8e9eadb Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 21 Mar 2016 00:52:24 +0000 Subject: [PATCH] Fix fallout from r292180 (Dec 2015)... ensure that every driver which has a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc. This is because the kernel linker only searches for symbols in dependent modules, so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc was not compiled into the kernel (even if you hand-loaded mmc first). (Thanks to jilles@ for providing the vital clue about the kernel linker.) --- sys/arm/allwinner/a10_mmc.c | 1 + sys/arm/amlogic/aml8726/aml8726_mmc.c | 1 + sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c | 1 + sys/arm/at91/at91_mci.c | 1 + sys/arm/broadcom/bcm2835/bcm2835_sdhci.c | 1 + sys/arm/freescale/imx/imx_sdhci.c | 1 + sys/arm/lpc/lpc_mmc.c | 1 + sys/arm/ti/ti_sdhci.c | 1 + sys/dev/mmc/host/dwmmc.c | 1 + sys/dev/mmc/mmc.c | 2 ++ sys/dev/sdhci/sdhci_fdt.c | 1 + sys/dev/sdhci/sdhci_pci.c | 1 + sys/powerpc/mpc85xx/fsl_sdhc.c | 2 +- 13 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/arm/allwinner/a10_mmc.c b/sys/arm/allwinner/a10_mmc.c index b236c4b4ac8e..dc341dd3e123 100644 --- a/sys/arm/allwinner/a10_mmc.c +++ b/sys/arm/allwinner/a10_mmc.c @@ -943,3 +943,4 @@ static driver_t a10_mmc_driver = { DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, 0, 0); DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(a10_mmc, mmc, 1, 1, 1); diff --git a/sys/arm/amlogic/aml8726/aml8726_mmc.c b/sys/arm/amlogic/aml8726/aml8726_mmc.c index a7cc9c1b6fe5..0e2497568fa7 100644 --- a/sys/arm/amlogic/aml8726/aml8726_mmc.c +++ b/sys/arm/amlogic/aml8726/aml8726_mmc.c @@ -1099,3 +1099,4 @@ DRIVER_MODULE(aml8726_mmc, simplebus, aml8726_mmc_driver, aml8726_mmc_devclass, 0, 0); MODULE_DEPEND(aml8726_mmc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_mmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(aml8726_mmc, mmc, 1, 1, 1); diff --git a/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c b/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c index fc6a66e0e230..3daa99fd8a41 100644 --- a/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c +++ b/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c @@ -1378,3 +1378,4 @@ DRIVER_MODULE(aml8726_sdxc, simplebus, aml8726_sdxc_driver, aml8726_sdxc_devclass, 0, 0); MODULE_DEPEND(aml8726_sdxc, aml8726_gpio, 1, 1, 1); DRIVER_MODULE(mmc, aml8726_sdxc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(aml8726_sdxc, mmc, 1, 1, 1); diff --git a/sys/arm/at91/at91_mci.c b/sys/arm/at91/at91_mci.c index 5bab815202a3..ba6040f68179 100644 --- a/sys/arm/at91/at91_mci.c +++ b/sys/arm/at91/at91_mci.c @@ -1412,3 +1412,4 @@ DRIVER_MODULE(at91_mci, atmelarm, at91_mci_driver, at91_mci_devclass, NULL, NULL); #endif DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(at91_mci, mmc, 1, 1, 1); diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c index 981d73b86f4b..700edcc7bc35 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c @@ -672,3 +672,4 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_bcm, mmc, 1, 1, 1); diff --git a/sys/arm/freescale/imx/imx_sdhci.c b/sys/arm/freescale/imx/imx_sdhci.c index fa9d8edd138e..2dc41dbcafba 100644 --- a/sys/arm/freescale/imx/imx_sdhci.c +++ b/sys/arm/freescale/imx/imx_sdhci.c @@ -836,3 +836,4 @@ static driver_t imx_sdhci_driver = { DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_imx, mmc, 1, 1, 1); diff --git a/sys/arm/lpc/lpc_mmc.c b/sys/arm/lpc/lpc_mmc.c index ad3b6aab2fc7..6c332156746f 100644 --- a/sys/arm/lpc/lpc_mmc.c +++ b/sys/arm/lpc/lpc_mmc.c @@ -776,3 +776,4 @@ static driver_t lpc_mmc_driver = { DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, 0, 0); DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(lpcmmc, mmc, 1, 1, 1); diff --git a/sys/arm/ti/ti_sdhci.c b/sys/arm/ti/ti_sdhci.c index 6c310b6f930e..a24e6936a621 100644 --- a/sys/arm/ti/ti_sdhci.c +++ b/sys/arm/ti/ti_sdhci.c @@ -722,3 +722,4 @@ static driver_t ti_sdhci_driver = { DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, 0, 0); MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_ti, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_ti, mmc, 1, 1, 1); diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 5dc062682ed8..5b24a6dc4ee6 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -1178,3 +1178,4 @@ static devclass_t dwmmc_devclass; DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, 0, 0); DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, 0, 0); DRIVER_MODULE(mmc, dwmmc, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(dwmmc, mmc, 1, 1, 1); diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c index a65ff41827b6..9f880799a60d 100644 --- a/sys/dev/mmc/mmc.c +++ b/sys/dev/mmc/mmc.c @@ -1811,3 +1811,5 @@ driver_t mmc_driver = { sizeof(struct mmc_softc), }; devclass_t mmc_devclass; + +MODULE_VERSION(mmc, 1); diff --git a/sys/dev/sdhci/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c index e49eda855c1c..27709d0a50e6 100644 --- a/sys/dev/sdhci/sdhci_fdt.c +++ b/sys/dev/sdhci/sdhci_fdt.c @@ -308,3 +308,4 @@ DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, NULL, NULL); MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_fdt, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_fdt, mmc, 1, 1, 1); diff --git a/sys/dev/sdhci/sdhci_pci.c b/sys/dev/sdhci/sdhci_pci.c index e0fd29c465b4..3ed43ab95f0d 100644 --- a/sys/dev/sdhci/sdhci_pci.c +++ b/sys/dev/sdhci/sdhci_pci.c @@ -475,3 +475,4 @@ DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_driver, sdhci_pci_devclass, NULL, NULL); MODULE_DEPEND(sdhci_pci, sdhci, 1, 1, 1); DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_pci, mmc, 1, 1, 1); diff --git a/sys/powerpc/mpc85xx/fsl_sdhc.c b/sys/powerpc/mpc85xx/fsl_sdhc.c index 174a8e614c2c..29bedd8b809c 100644 --- a/sys/powerpc/mpc85xx/fsl_sdhc.c +++ b/sys/powerpc/mpc85xx/fsl_sdhc.c @@ -126,7 +126,7 @@ static devclass_t fsl_sdhc_devclass; DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); - +MODULE_DEPEND(sdhci_fsl, mmc, 1, 1, 1); /***************************************************************************** * Private methods