Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2017 22:42:44 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314887 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm/at91 arm/broadcom/bcm2835 arm/lpc arm/nvidia arm/ti dev/mmc dev/mmc/host dev/sdhci mips/ingenic
Message-ID:  <201703072242.v27MgiLA098983@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Tue Mar  7 22:42:44 2017
New Revision: 314887
URL: https://svnweb.freebsd.org/changeset/base/314887

Log:
  Add and use a MMC_DECLARE_BRIDGE macro for declaring mmc(4) bridges
  as kernel drivers and their dependency onto mmc(4); this allows for
  incrementing the mmc(4) module version but also for entire omission
  of these bridge declarations for mmccam(4) in a single place, i. e.
  in dev/mmc/bridge.h.

Modified:
  head/sys/arm/allwinner/a10_mmc.c
  head/sys/arm/amlogic/aml8726/aml8726_mmc.c
  head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
  head/sys/arm/at91/at91_mci.c
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
  head/sys/arm/lpc/lpc_mmc.c
  head/sys/arm/nvidia/tegra_sdhci.c
  head/sys/arm/ti/ti_sdhci.c
  head/sys/dev/mmc/bridge.h
  head/sys/dev/mmc/host/dwmmc.c
  head/sys/dev/sdhci/fsl_sdhci.c
  head/sys/dev/sdhci/sdhci_acpi.c
  head/sys/dev/sdhci/sdhci_fdt.c
  head/sys/dev/sdhci/sdhci_pci.c
  head/sys/mips/ingenic/jz4780_mmc.c

Modified: head/sys/arm/allwinner/a10_mmc.c
==============================================================================
--- head/sys/arm/allwinner/a10_mmc.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/allwinner/a10_mmc.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -918,5 +918,4 @@ static driver_t a10_mmc_driver = {
 
 DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, NULL,
     NULL);
-DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL);
-MODULE_DEPEND(a10_mmc, mmc, 1, 1, 1);
+MMC_DECLARE_BRIDGE(a10_mmc);

Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c
==============================================================================
--- head/sys/arm/amlogic/aml8726/aml8726_mmc.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -1095,5 +1095,4 @@ static devclass_t aml8726_mmc_devclass;
 DRIVER_MODULE(aml8726_mmc, simplebus, aml8726_mmc_driver,
     aml8726_mmc_devclass, NULL, NULL);
 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);
+MMC_DECLARE_BRIDGE(aml8726_mmc);

Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
==============================================================================
--- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -1375,5 +1375,4 @@ static devclass_t aml8726_sdxc_devclass;
 DRIVER_MODULE(aml8726_sdxc, simplebus, aml8726_sdxc_driver,
     aml8726_sdxc_devclass, NULL, NULL);
 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);
+MMC_DECLARE_BRIDGE(aml8726_sdxc);

Modified: head/sys/arm/at91/at91_mci.c
==============================================================================
--- head/sys/arm/at91/at91_mci.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/at91/at91_mci.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -1400,5 +1400,5 @@ DRIVER_MODULE(at91_mci, simplebus, at91_
 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);
+
+MMC_DECLARE_BRIDGE(at91_mci);

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -679,5 +679,4 @@ static driver_t bcm_sdhci_driver = {
 DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass,
     NULL, NULL);
 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);
+MMC_DECLARE_BRIDGE(sdhci_bcm);

Modified: head/sys/arm/lpc/lpc_mmc.c
==============================================================================
--- head/sys/arm/lpc/lpc_mmc.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/lpc/lpc_mmc.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -761,5 +761,4 @@ static driver_t lpc_mmc_driver = {
 };
 
 DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, NULL, NULL);
-DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL);
-MODULE_DEPEND(lpcmmc, mmc, 1, 1, 1);
+MMC_DECLARE_BRIDGE(lpcmmc);

Modified: head/sys/arm/nvidia/tegra_sdhci.c
==============================================================================
--- head/sys/arm/nvidia/tegra_sdhci.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/nvidia/tegra_sdhci.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -464,5 +464,4 @@ static DEFINE_CLASS_0(sdhci, tegra_sdhci
 DRIVER_MODULE(sdhci_tegra, simplebus, tegra_sdhci_driver, tegra_sdhci_devclass,
     NULL, NULL);
 MODULE_DEPEND(sdhci_tegra, sdhci, 1, 1, 1);
-DRIVER_MODULE(mmc, sdhci, mmc_driver, mmc_devclass, NULL, NULL);
-MODULE_DEPEND(sdhci_tegra, mmc, 1, 1, 1);
+MMC_DECLARE_BRIDGE(sdhci_tegra);

Modified: head/sys/arm/ti/ti_sdhci.c
==============================================================================
--- head/sys/arm/ti/ti_sdhci.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/arm/ti/ti_sdhci.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -725,5 +725,4 @@ static driver_t ti_sdhci_driver = {
 DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, NULL,
     NULL);
 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);
+MMC_DECLARE_BRIDGE(sdhci_ti);

Modified: head/sys/dev/mmc/bridge.h
==============================================================================
--- head/sys/dev/mmc/bridge.h	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/dev/mmc/bridge.h	Tue Mar  7 22:42:44 2017	(r314887)
@@ -139,4 +139,10 @@ struct mmc_host {
 extern driver_t   mmc_driver;
 extern devclass_t mmc_devclass;
 
+#define	MMC_VERSION	1
+
+#define	MMC_DECLARE_BRIDGE(name)					\
+    DRIVER_MODULE(mmc, name, mmc_driver, mmc_devclass, NULL, NULL);	\
+    MODULE_DEPEND(name, mmc, MMC_VERSION, MMC_VERSION, MMC_VERSION);
+
 #endif /* DEV_MMC_BRIDGE_H */

Modified: head/sys/dev/mmc/host/dwmmc.c
==============================================================================
--- head/sys/dev/mmc/host/dwmmc.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/dev/mmc/host/dwmmc.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -1181,5 +1181,4 @@ static devclass_t dwmmc_devclass;
 
 DRIVER_MODULE(dwmmc, simplebus, dwmmc_driver, dwmmc_devclass, NULL, NULL);
 DRIVER_MODULE(dwmmc, ofwbus, dwmmc_driver, dwmmc_devclass, NULL, NULL);
-DRIVER_MODULE(mmc, dwmmc, mmc_driver, mmc_devclass, NULL, NULL);
-MODULE_DEPEND(dwmmc, mmc, 1, 1, 1);
+MMC_DECLARE_BRIDGE(dwmmc);

Modified: head/sys/dev/sdhci/fsl_sdhci.c
==============================================================================
--- head/sys/dev/sdhci/fsl_sdhci.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/dev/sdhci/fsl_sdhci.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -994,5 +994,4 @@ static driver_t fsl_sdhci_driver = {
 DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhci_driver, fsl_sdhci_devclass,
     NULL, NULL);
 MODULE_DEPEND(sdhci_fsl, sdhci, 1, 1, 1);
-DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL);
-MODULE_DEPEND(sdhci_fsl, mmc, 1, 1, 1);
+MMC_DECLARE_BRIDGE(sdhci_fsl);

Modified: head/sys/dev/sdhci/sdhci_acpi.c
==============================================================================
--- head/sys/dev/sdhci/sdhci_acpi.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/dev/sdhci/sdhci_acpi.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -368,5 +368,4 @@ static devclass_t sdhci_acpi_devclass;
 DRIVER_MODULE(sdhci_acpi, acpi, sdhci_acpi_driver, sdhci_acpi_devclass, NULL,
     NULL);
 MODULE_DEPEND(sdhci_acpi, sdhci, 1, 1, 1);
-DRIVER_MODULE(mmc, sdhci_acpi, mmc_driver, mmc_devclass, NULL, NULL);
-MODULE_DEPEND(sdhci_acpi, mmc, 1, 1, 1);
+MMC_DECLARE_BRIDGE(sdhci_acpi);

Modified: head/sys/dev/sdhci/sdhci_fdt.c
==============================================================================
--- head/sys/dev/sdhci/sdhci_fdt.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/dev/sdhci/sdhci_fdt.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -306,5 +306,4 @@ static devclass_t sdhci_fdt_devclass;
 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);
+MMC_DECLARE_BRIDGE(sdhci_fdt);

Modified: head/sys/dev/sdhci/sdhci_pci.c
==============================================================================
--- head/sys/dev/sdhci/sdhci_pci.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/dev/sdhci/sdhci_pci.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -486,5 +486,4 @@ static devclass_t sdhci_pci_devclass;
 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);
+MMC_DECLARE_BRIDGE(sdhci_pci);

Modified: head/sys/mips/ingenic/jz4780_mmc.c
==============================================================================
--- head/sys/mips/ingenic/jz4780_mmc.c	Tue Mar  7 22:16:55 2017	(r314886)
+++ head/sys/mips/ingenic/jz4780_mmc.c	Tue Mar  7 22:42:44 2017	(r314887)
@@ -989,5 +989,4 @@ static driver_t jz4780_mmc_driver = {
 
 DRIVER_MODULE(jzmmc, simplebus, jz4780_mmc_driver, jz4780_mmc_devclass, NULL,
     NULL);
-DRIVER_MODULE(mmc, jzmmc, mmc_driver, mmc_devclass, NULL, NULL);
-MODULE_DEPEND(jzmmc, mmc, 1, 1, 1);
+MMC_DECLARE_BRIDGE(jzmmc);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703072242.v27MgiLA098983>