[PATCH] mmc: host: Move MODULE_DEVICE_TABLE next to the table itself

Krzysztof Kozlowski posted 1 patch 1 month, 1 week ago
drivers/mmc/host/cavium-thunderx.c | 2 +-
drivers/mmc/host/tifm_sd.c         | 2 +-
drivers/mmc/host/wmt-sdmmc.c       | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
[PATCH] mmc: host: Move MODULE_DEVICE_TABLE next to the table itself
Posted by Krzysztof Kozlowski 1 month, 1 week ago
By convention MODULE_DEVICE_TABLE() immediately follows the ID table it
exports, because this is easier to read and verify.  It also makes more
sense since #ifdef for ACPI or OF could hide both of them.

Most of the privers already have this correctly placed, so adjust
the missing ones.  No functional impact.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/mmc/host/cavium-thunderx.c | 2 +-
 drivers/mmc/host/tifm_sd.c         | 2 +-
 drivers/mmc/host/wmt-sdmmc.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
index 1373deb3f531..84ff6d82ae3c 100644
--- a/drivers/mmc/host/cavium-thunderx.c
+++ b/drivers/mmc/host/cavium-thunderx.c
@@ -188,6 +188,7 @@ static const struct pci_device_id thunder_mmc_id_table[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, 0xa010) },
 	{ 0, }  /* end of table */
 };
+MODULE_DEVICE_TABLE(pci, thunder_mmc_id_table);
 
 static struct pci_driver thunder_mmc_driver = {
 	.name = KBUILD_MODNAME,
@@ -201,4 +202,3 @@ module_pci_driver(thunder_mmc_driver);
 MODULE_AUTHOR("Cavium Inc.");
 MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");
 MODULE_LICENSE("GPL");
-MODULE_DEVICE_TABLE(pci, thunder_mmc_id_table);
diff --git a/drivers/mmc/host/tifm_sd.c b/drivers/mmc/host/tifm_sd.c
index c1f7d5b37911..aebffd3ebf60 100644
--- a/drivers/mmc/host/tifm_sd.c
+++ b/drivers/mmc/host/tifm_sd.c
@@ -1044,6 +1044,7 @@ static int tifm_sd_resume(struct tifm_dev *sock)
 static struct tifm_device_id tifm_sd_id_tbl[] = {
 	{ TIFM_TYPE_SD }, { }
 };
+MODULE_DEVICE_TABLE(tifm, tifm_sd_id_tbl);
 
 static struct tifm_driver tifm_sd_driver = {
 	.driver = {
@@ -1070,7 +1071,6 @@ static void __exit tifm_sd_exit(void)
 MODULE_AUTHOR("Alex Dubov");
 MODULE_DESCRIPTION("TI FlashMedia SD driver");
 MODULE_LICENSE("GPL");
-MODULE_DEVICE_TABLE(tifm, tifm_sd_id_tbl);
 MODULE_VERSION(DRIVER_VERSION);
 
 module_init(tifm_sd_init);
diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
index 1b1d691e19fc..489daee4f4fc 100644
--- a/drivers/mmc/host/wmt-sdmmc.c
+++ b/drivers/mmc/host/wmt-sdmmc.c
@@ -744,6 +744,7 @@ static const struct of_device_id wmt_mci_dt_ids[] = {
 	{ .compatible = "wm,wm8505-sdhc", .data = &wm8505_caps },
 	{ /* Sentinel */ },
 };
+MODULE_DEVICE_TABLE(of, wmt_mci_dt_ids);
 
 static int wmt_mci_probe(struct platform_device *pdev)
 {
@@ -980,4 +981,3 @@ module_platform_driver(wmt_mci_driver);
 MODULE_DESCRIPTION("Wondermedia MMC/SD Driver");
 MODULE_AUTHOR("Tony Prisk");
 MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, wmt_mci_dt_ids);
-- 
2.51.0
Re: [PATCH] mmc: host: Move MODULE_DEVICE_TABLE next to the table itself
Posted by Ulf Hansson 1 month ago
On Tue, 5 May 2026 at 12:33, Krzysztof Kozlowski
<krzysztof.kozlowski@oss.qualcomm.com> wrote:
>
> By convention MODULE_DEVICE_TABLE() immediately follows the ID table it
> exports, because this is easier to read and verify.  It also makes more
> sense since #ifdef for ACPI or OF could hide both of them.
>
> Most of the privers already have this correctly placed, so adjust
> the missing ones.  No functional impact.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/cavium-thunderx.c | 2 +-
>  drivers/mmc/host/tifm_sd.c         | 2 +-
>  drivers/mmc/host/wmt-sdmmc.c       | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
> index 1373deb3f531..84ff6d82ae3c 100644
> --- a/drivers/mmc/host/cavium-thunderx.c
> +++ b/drivers/mmc/host/cavium-thunderx.c
> @@ -188,6 +188,7 @@ static const struct pci_device_id thunder_mmc_id_table[] = {
>         { PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, 0xa010) },
>         { 0, }  /* end of table */
>  };
> +MODULE_DEVICE_TABLE(pci, thunder_mmc_id_table);
>
>  static struct pci_driver thunder_mmc_driver = {
>         .name = KBUILD_MODNAME,
> @@ -201,4 +202,3 @@ module_pci_driver(thunder_mmc_driver);
>  MODULE_AUTHOR("Cavium Inc.");
>  MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");
>  MODULE_LICENSE("GPL");
> -MODULE_DEVICE_TABLE(pci, thunder_mmc_id_table);
> diff --git a/drivers/mmc/host/tifm_sd.c b/drivers/mmc/host/tifm_sd.c
> index c1f7d5b37911..aebffd3ebf60 100644
> --- a/drivers/mmc/host/tifm_sd.c
> +++ b/drivers/mmc/host/tifm_sd.c
> @@ -1044,6 +1044,7 @@ static int tifm_sd_resume(struct tifm_dev *sock)
>  static struct tifm_device_id tifm_sd_id_tbl[] = {
>         { TIFM_TYPE_SD }, { }
>  };
> +MODULE_DEVICE_TABLE(tifm, tifm_sd_id_tbl);
>
>  static struct tifm_driver tifm_sd_driver = {
>         .driver = {
> @@ -1070,7 +1071,6 @@ static void __exit tifm_sd_exit(void)
>  MODULE_AUTHOR("Alex Dubov");
>  MODULE_DESCRIPTION("TI FlashMedia SD driver");
>  MODULE_LICENSE("GPL");
> -MODULE_DEVICE_TABLE(tifm, tifm_sd_id_tbl);
>  MODULE_VERSION(DRIVER_VERSION);
>
>  module_init(tifm_sd_init);
> diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
> index 1b1d691e19fc..489daee4f4fc 100644
> --- a/drivers/mmc/host/wmt-sdmmc.c
> +++ b/drivers/mmc/host/wmt-sdmmc.c
> @@ -744,6 +744,7 @@ static const struct of_device_id wmt_mci_dt_ids[] = {
>         { .compatible = "wm,wm8505-sdhc", .data = &wm8505_caps },
>         { /* Sentinel */ },
>  };
> +MODULE_DEVICE_TABLE(of, wmt_mci_dt_ids);
>
>  static int wmt_mci_probe(struct platform_device *pdev)
>  {
> @@ -980,4 +981,3 @@ module_platform_driver(wmt_mci_driver);
>  MODULE_DESCRIPTION("Wondermedia MMC/SD Driver");
>  MODULE_AUTHOR("Tony Prisk");
>  MODULE_LICENSE("GPL v2");
> -MODULE_DEVICE_TABLE(of, wmt_mci_dt_ids);
> --
> 2.51.0
>