Re: [RFC 13/17] usb/ehci: Allow to build multiple platform glue drivers at the same time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 29, 2011 at 2:51 AM, Sebastian Andrzej Siewior
<sebastian@xxxxxxxxxxxxx> wrote:
> This patch moves the include of the glue code for platform devices out
> into a separate file. The ifdefs are moved into the files arch files. Each
> file provides a register and unregister function. This changes makes it
> possible to build multiple platform drivers at the same time.
>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@xxxxxxxxxxxxx>
> ---
>  drivers/usb/host/ehci-ath79.c    |   21 +++++
>  drivers/usb/host/ehci-atmel.c    |   21 +++++
>  drivers/usb/host/ehci-au1xxx.c   |   21 +++++
>  drivers/usb/host/ehci-cns3xxx.c  |   21 +++++
>  drivers/usb/host/ehci-fsl.c      |   21 +++++
>  drivers/usb/host/ehci-grlib.c    |   21 +++++
>  drivers/usb/host/ehci-ixp4xx.c   |   21 +++++
>  drivers/usb/host/ehci-msm.c      |   21 +++++
>  drivers/usb/host/ehci-mxc.c      |   21 +++++
>  drivers/usb/host/ehci-octeon.c   |   21 +++++
>  drivers/usb/host/ehci-omap.c     |   21 +++++
>  drivers/usb/host/ehci-orion.c    |   21 +++++
>  drivers/usb/host/ehci-platform.c |  161 ++++++++++++++++++++++++++++++++++++++
>  drivers/usb/host/ehci-pmcmsp.c   |   21 +++++
>  drivers/usb/host/ehci-pxa168.c   |   21 +++++
>  drivers/usb/host/ehci-s5p.c      |   21 +++++
>  drivers/usb/host/ehci-sh.c       |   21 +++++
>  drivers/usb/host/ehci-spear.c    |   21 +++++
>  drivers/usb/host/ehci-tegra.c    |   21 +++++
>  drivers/usb/host/ehci-vt8500.c   |   21 +++++
>  drivers/usb/host/ehci-w90x900.c  |   21 +++++
>  drivers/usb/host/ehci-xls.c      |   21 +++++
>  drivers/usb/host/ehci.c          |  123 +----------------------------
>  drivers/usb/host/ehci.h          |    3 +
>  24 files changed, 608 insertions(+), 120 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-ath79.c b/drivers/usb/host/ehci-ath79.c
> index 4d2e88d..0af9637 100644
> --- a/drivers/usb/host/ehci-ath79.c
> +++ b/drivers/usb/host/ehci-ath79.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_ATH79
>  /*
>  *  Bus Glue for Atheros AR7XXX/AR9XXX built-in EHCI controller.
>  *
> @@ -202,3 +203,23 @@ static struct platform_driver ehci_ath79_driver = {
>  };
>
>  MODULE_ALIAS(PLATFORM_MODULE_PREFIX "ath79-ehci");
> +
> +static int ehci_register_ehci_ath79_driver(void)
> +{
> +       return platform_driver_register(&ehci_ath79_driver);
> +}
> +
> +static void ehci_unregister_ehci_ath79_driver(void)
> +{
> +       platform_driver_unregister(&ehci_ath79_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_ath79_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_ath79_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
> index a5a3ef1..87f6fc8 100644
> --- a/drivers/usb/host/ehci-atmel.c
> +++ b/drivers/usb/host/ehci-atmel.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_ARCH_AT91
>  /*
>  * Driver for EHCI UHP on Atmel chips
>  *
> @@ -231,3 +232,23 @@ static struct platform_driver ehci_atmel_driver = {
>        .shutdown       = usb_hcd_platform_shutdown,
>        .driver.name    = "atmel-ehci",
>  };
> +
> +static int ehci_register_ehci_atmel_driver(void)
> +{
> +       return platform_driver_register(&ehci_atmel_driver);
> +}
> +
> +static void ehci_unregister_ehci_atmel_driver(void)
> +{
> +       platform_driver_unregister(&ehci_atmel_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_atmel_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_atmel_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c
> index 43f6ff0..36769aa 100644
> --- a/drivers/usb/host/ehci-au1xxx.c
> +++ b/drivers/usb/host/ehci-au1xxx.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_SOC_AU1200
>  /*
>  * EHCI HCD (Host Controller Driver) for USB.
>  *
> @@ -291,3 +292,23 @@ static struct platform_driver ehci_hcd_au1xxx_driver = {
>  };
>
>  MODULE_ALIAS("platform:au1xxx-ehci");
> +
> +static int ehci_register_ehci_hcd_au1xxx_driver(void)
> +{
> +       return platform_driver_register(&ehci_hcd_au1xxx_driver);
> +}
> +
> +static void ehci_unregister_ehci_hcd_au1xxx_driver(void)
> +{
> +       platform_driver_unregister(&ehci_hcd_au1xxx_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_hcd_au1xxx_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_hcd_au1xxx_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-cns3xxx.c b/drivers/usb/host/ehci-cns3xxx.c
> index 6536abd..2f07af8 100644
> --- a/drivers/usb/host/ehci-cns3xxx.c
> +++ b/drivers/usb/host/ehci-cns3xxx.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_CNS3XXX_EHCI
>  /*
>  * Copyright 2008 Cavium Networks
>  *
> @@ -169,3 +170,23 @@ static struct platform_driver cns3xxx_ehci_driver = {
>                .name = "cns3xxx-ehci",
>        },
>  };
> +
> +static int ehci_register_cns3xxx_ehci_driver(void)
> +{
> +       return platform_driver_register(&cns3xxx_ehci_driver);
> +}
> +
> +static void ehci_unregister_cns3xxx_ehci_driver(void)
> +{
> +       platform_driver_unregister(&cns3xxx_ehci_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_cns3xxx_ehci_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_cns3xxx_ehci_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
> index 3bf9f16..03d0810 100644
> --- a/drivers/usb/host/ehci-fsl.c
> +++ b/drivers/usb/host/ehci-fsl.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_FSL
>  /*
>  * Copyright 2005-2009 MontaVista Software, Inc.
>  * Copyright 2008      Freescale Semiconductor, Inc.
> @@ -684,3 +685,23 @@ static struct platform_driver ehci_fsl_driver = {
>                .pm = EHCI_FSL_PM_OPS,
>        },
>  };
> +
> +static int ehci_register_ehci_fsl_driver(void)
> +{
> +       return platform_driver_register(&ehci_fsl_driver);
> +}
> +
> +static void ehci_unregister_ehci_fsl_driver(void)
> +{
> +       platform_driver_unregister(&ehci_fsl_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_fsl_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_fsl_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c
> index fdfd8c5..8660d03 100644
> --- a/drivers/usb/host/ehci-grlib.c
> +++ b/drivers/usb/host/ehci-grlib.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_SPARC_LEON
>  /*
>  * Driver for Aeroflex Gaisler GRLIB GRUSBHC EHCI host controller
>  *
> @@ -240,3 +241,23 @@ static struct platform_driver ehci_grlib_driver = {
>                .of_match_table = ehci_hcd_grlib_of_match,
>        },
>  };
> +
> +static int ehci_register_ehci_grlib_driver(void)
> +{
> +       return platform_driver_register(&ehci_grlib_driver);
> +}
> +
> +static void ehci_unregister_ehci_grlib_driver(void)
> +{
> +       platform_driver_unregister(&ehci_grlib_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_grlib_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_grlib_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-ixp4xx.c b/drivers/usb/host/ehci-ixp4xx.c
> index c4460f3..b5c67d5 100644
> --- a/drivers/usb/host/ehci-ixp4xx.c
> +++ b/drivers/usb/host/ehci-ixp4xx.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_ARCH_IXP4XX
>  /*
>  * IXP4XX EHCI Host Controller Driver
>  *
> @@ -154,3 +155,23 @@ static struct platform_driver ixp4xx_ehci_driver = {
>                .name = "ixp4xx-ehci",
>        },
>  };
> +
> +static int ehci_register_ixp4xx_ehci_driver(void)
> +{
> +       return platform_driver_register(&ixp4xx_ehci_driver);
> +}
> +
> +static void ehci_unregister_ixp4xx_ehci_driver(void)
> +{
> +       platform_driver_unregister(&ixp4xx_ehci_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ixp4xx_ehci_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ixp4xx_ehci_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
> index 592d5f7..fbfa976 100644
> --- a/drivers/usb/host/ehci-msm.c
> +++ b/drivers/usb/host/ehci-msm.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_MSM
>  /* ehci-msm.c - HSUSB Host Controller Driver Implementation
>  *
>  * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
> @@ -245,3 +246,23 @@ static struct platform_driver ehci_msm_driver = {
>                   .pm = &ehci_msm_dev_pm_ops,
>        },
>  };
> +
> +static int ehci_register_ehci_msm_driver(void)
> +{
> +       return platform_driver_register(&ehci_msm_driver);
> +}
> +
> +static void ehci_unregister_ehci_msm_driver(void)
> +{
> +       platform_driver_unregister(&ehci_msm_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_msm_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_msm_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
> index 555a73c..e2584fc 100644
> --- a/drivers/usb/host/ehci-mxc.c
> +++ b/drivers/usb/host/ehci-mxc.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_MXC
>  /*
>  * Copyright (c) 2008 Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>, Pengutronix
>  * Copyright (c) 2009 Daniel Mack <daniel@xxxxxxxx>
> @@ -340,3 +341,23 @@ static struct platform_driver ehci_mxc_driver = {
>                   .name = "mxc-ehci",
>        },
>  };
> +
> +static int ehci_register_ehci_mxc_driver(void)
> +{
> +       return platform_driver_register(&ehci_mxc_driver);
> +}
> +
> +static void ehci_unregister_ehci_mxc_driver(void)
> +{
> +       platform_driver_unregister(&ehci_mxc_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_mxc_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_mxc_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c
> index c3ba3ed..39a4ade 100644
> --- a/drivers/usb/host/ehci-octeon.c
> +++ b/drivers/usb/host/ehci-octeon.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_OCTEON_EHCI
>  /*
>  * EHCI HCD glue for Cavium Octeon II SOCs.
>  *
> @@ -205,3 +206,23 @@ static struct platform_driver ehci_octeon_driver = {
>  };
>
>  MODULE_ALIAS("platform:" OCTEON_EHCI_HCD_NAME);
> +
> +static int ehci_register_ehci_octeon_driver(void)
> +{
> +       return platform_driver_register(&ehci_octeon_driver);
> +}
> +
> +static void ehci_unregister_ehci_octeon_driver(void)
> +{
> +       platform_driver_unregister(&ehci_octeon_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_octeon_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_octeon_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 4524032..bc0cfbf 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_HCD_OMAP
>  /*
>  * ehci-omap.c - driver for USBHOST on OMAP3/4 processors
>  *
> @@ -341,3 +342,23 @@ MODULE_ALIAS("platform:omap-ehci");
>  MODULE_AUTHOR("Texas Instruments, Inc.");
>  MODULE_AUTHOR("Felipe Balbi <felipe.balbi@xxxxxxxxx>");
>
> +
> +static int ehci_register_ehci_hcd_omap_driver(void)
> +{
> +       return platform_driver_register(&ehci_hcd_omap_driver);
> +}
> +
> +static void ehci_unregister_ehci_hcd_omap_driver(void)
> +{
> +       platform_driver_unregister(&ehci_hcd_omap_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_hcd_omap_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_hcd_omap_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
> index 395bdb0..8f9a4c4 100644
> --- a/drivers/usb/host/ehci-orion.c
> +++ b/drivers/usb/host/ehci-orion.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_PLAT_ORION
>  /*
>  * drivers/usb/host/ehci-orion.c
>  *
> @@ -316,3 +317,23 @@ static struct platform_driver ehci_orion_driver = {
>        .shutdown       = usb_hcd_platform_shutdown,
>        .driver.name    = "orion-ehci",
>  };
> +
> +static int ehci_register_ehci_orion_driver(void)
> +{
> +       return platform_driver_register(&ehci_orion_driver);
> +}
> +
> +static void ehci_unregister_ehci_orion_driver(void)
> +{
> +       platform_driver_unregister(&ehci_orion_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_orion_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_orion_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> index d9d3351..696bf8b 100644
> --- a/drivers/usb/host/ehci-platform.c
> +++ b/drivers/usb/host/ehci-platform.c
> @@ -68,3 +68,164 @@ void ehci_hcd_plat_cleanup(struct platform_device *pdev, struct usb_hcd *hcd)
>        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
>        usb_put_hcd(hcd);
>  }
> +
> +#include "ehci-ath79.c"
> +#include "ehci-atmel.c"
> +#include "ehci-au1xxx.c"
> +#include "ehci-cns3xxx.c"
> +#include "ehci-fsl.c"
> +#include "ehci-grlib.c"
> +#include "ehci-ixp4xx.c"
> +#include "ehci-msm.c"
> +#include "ehci-mxc.c"
> +#include "ehci-octeon.c"
> +#include "ehci-omap.c"
> +#include "ehci-orion.c"
> +#include "ehci-pmcmsp.c"
> +#include "ehci-pxa168.c"
> +#include "ehci-s5p.c"
> +#include "ehci-sh.c"
> +#include "ehci-spear.c"
> +#include "ehci-tegra.c"
> +#include "ehci-vt8500.c"
> +#include "ehci-w90x900.c"
> +#include "ehci-xls.c"
> +
> +int ehci_register_platforms(void)
> +{
> +       int ret;
> +
> +       ret = ehci_register_ehci_ath79_driver();
> +       if (ret)
> +               goto err_1;
> +       ret = ehci_register_ehci_atmel_driver();
> +       if (ret)
> +               goto err_2;
> +       ret = ehci_register_ehci_hcd_au1xxx_driver();
> +       if (ret)
> +               goto err_3;
> +       ret = ehci_register_cns3xxx_ehci_driver();
> +       if (ret)
> +               goto err_4;
> +       ret = ehci_register_ehci_fsl_driver();
> +       if (ret)
> +               goto err_5;
> +       ret = ehci_register_ehci_grlib_driver();
> +       if (ret)
> +               goto err_6;
> +       ret = ehci_register_ixp4xx_ehci_driver();
> +       if (ret)
> +               goto err_7;
> +       ret = ehci_register_ehci_msm_driver();
> +       if (ret)
> +               goto err_8;
> +       ret = ehci_register_ehci_mxc_driver();
> +       if (ret)
> +               goto err_9;
> +       ret = ehci_register_ehci_octeon_driver();
> +       if (ret)
> +               goto err_10;
> +       ret = ehci_register_ehci_hcd_omap_driver();
> +       if (ret)
> +               goto err_11;
> +       ret = ehci_register_ehci_orion_driver();
> +       if (ret)
> +               goto err_12;
> +       ret = ehci_register_ehci_hcd_msp_driver();
> +       if (ret)
> +               goto err_13;
> +       ret = ehci_register_ehci_pxa168_driver();
> +       if (ret)
> +               goto err_14;
> +       ret = ehci_register_s5p_ehci_driver();
> +       if (ret)
> +               goto err_15;
> +       ret = ehci_register_ehci_hcd_sh_driver();
> +       if (ret)
> +               goto err_16;
> +       ret = ehci_register_spear_ehci_hcd_driver();
> +       if (ret)
> +               goto err_17;
> +       ret = ehci_register_tegra_ehci_driver();
> +       if (ret)
> +               goto err_18;
> +       ret = ehci_register_vt8500_ehci_driver();
> +       if (ret)
> +               goto err_19;
> +       ret = ehci_register_ehci_hcd_w90x900_driver();
> +       if (ret)
> +               goto err_20;
> +       ret = ehci_register_ehci_xls_driver();
> +       if (ret)
> +               goto err_21;
> +       return ret;
> +
> +       ehci_unregister_ehci_xls_driver();
> +err_21:
> +       ehci_unregister_ehci_hcd_w90x900_driver();
> +err_20:
> +       ehci_unregister_vt8500_ehci_driver();
> +err_19:
> +       ehci_unregister_tegra_ehci_driver();
> +err_18:
> +       ehci_unregister_spear_ehci_hcd_driver();
> +err_17:
> +       ehci_unregister_ehci_hcd_sh_driver();
> +err_16:
> +       ehci_unregister_s5p_ehci_driver();
> +err_15:
> +       ehci_unregister_ehci_pxa168_driver();
> +err_14:
> +       ehci_unregister_ehci_hcd_msp_driver();
> +err_13:
> +       ehci_unregister_ehci_orion_driver();
> +err_12:
> +       ehci_unregister_ehci_hcd_omap_driver();
> +err_11:
> +       ehci_unregister_ehci_octeon_driver();
> +err_10:
> +       ehci_unregister_ehci_mxc_driver();
> +err_9:
> +       ehci_unregister_ehci_msm_driver();
> +err_8:
> +       ehci_unregister_ixp4xx_ehci_driver();
> +err_7:
> +       ehci_unregister_ehci_grlib_driver();
> +err_6:
> +       ehci_unregister_ehci_fsl_driver();
> +err_5:
> +       ehci_unregister_cns3xxx_ehci_driver();
> +err_4:
> +       ehci_unregister_ehci_hcd_au1xxx_driver();
> +err_3:
> +       ehci_unregister_ehci_atmel_driver();
> +err_2:
> +       ehci_unregister_ehci_ath79_driver();
> +err_1:
> +       return ret;
> +}
> +
> +void ehci_unregister_platforms(void)
> +{
> +       ehci_unregister_ehci_xls_driver();
> +       ehci_unregister_ehci_hcd_w90x900_driver();
> +       ehci_unregister_vt8500_ehci_driver();
> +       ehci_unregister_tegra_ehci_driver();
> +       ehci_unregister_spear_ehci_hcd_driver();
> +       ehci_unregister_ehci_hcd_sh_driver();
> +       ehci_unregister_s5p_ehci_driver();
> +       ehci_unregister_ehci_pxa168_driver();
> +       ehci_unregister_ehci_hcd_msp_driver();
> +       ehci_unregister_ehci_orion_driver();
> +       ehci_unregister_ehci_hcd_omap_driver();
> +       ehci_unregister_ehci_octeon_driver();
> +       ehci_unregister_ehci_mxc_driver();
> +       ehci_unregister_ehci_msm_driver();
> +       ehci_unregister_ixp4xx_ehci_driver();
> +       ehci_unregister_ehci_grlib_driver();
> +       ehci_unregister_ehci_fsl_driver();
> +       ehci_unregister_cns3xxx_ehci_driver();
> +       ehci_unregister_ehci_hcd_au1xxx_driver();
> +       ehci_unregister_ehci_atmel_driver();
> +       ehci_unregister_ehci_ath79_driver();
> +}

These driver register/unregister functions can be added to module_init
in ehci-<plat>.c. And only the required ehci-<plat>.c should be
compiled by setting appropriate macros based on the platform.

> diff --git a/drivers/usb/host/ehci-pmcmsp.c b/drivers/usb/host/ehci-pmcmsp.c
> index e8d54de..7b3bc25 100644
> --- a/drivers/usb/host/ehci-pmcmsp.c
> +++ b/drivers/usb/host/ehci-pmcmsp.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_HCD_PMC_MSP
>  /*
>  * PMC MSP EHCI (Host Controller Driver) for USB.
>  *
> @@ -381,3 +382,23 @@ static struct platform_driver ehci_hcd_msp_driver = {
>                .owner  = THIS_MODULE,
>        },
>  };
> +
> +static int ehci_register_ehci_hcd_msp_driver(void)
> +{
> +       return platform_driver_register(&ehci_hcd_msp_driver);
> +}
> +
> +static void ehci_unregister_ehci_hcd_msp_driver(void)
> +{
> +       platform_driver_unregister(&ehci_hcd_msp_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_hcd_msp_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_hcd_msp_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-pxa168.c b/drivers/usb/host/ehci-pxa168.c
> index ac0c16e..08a4f69 100644
> --- a/drivers/usb/host/ehci-pxa168.c
> +++ b/drivers/usb/host/ehci-pxa168.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_PXA168_EHCI
>  /*
>  * drivers/usb/host/ehci-pxa168.c
>  *
> @@ -361,3 +362,23 @@ static struct platform_driver ehci_pxa168_driver = {
>        .shutdown       = usb_hcd_platform_shutdown,
>        .driver.name    = "pxa168-ehci",
>  };
> +
> +static int ehci_register_ehci_pxa168_driver(void)
> +{
> +       return platform_driver_register(&ehci_pxa168_driver);
> +}
> +
> +static void ehci_unregister_ehci_pxa168_driver(void)
> +{
> +       platform_driver_unregister(&ehci_pxa168_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_pxa168_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_pxa168_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
> index 64bcf66..e6a7fc2 100644
> --- a/drivers/usb/host/ehci-s5p.c
> +++ b/drivers/usb/host/ehci-s5p.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_S5P
>  /*
>  * SAMSUNG S5P USB HOST EHCI Controller
>  *
> @@ -296,3 +297,23 @@ static struct platform_driver s5p_ehci_driver = {
>  };
>
>  MODULE_ALIAS("platform:s5p-ehci");
> +
> +static int ehci_register_s5p_ehci_driver(void)
> +{
> +       return platform_driver_register(&s5p_ehci_driver);
> +}
> +
> +static void ehci_unregister_s5p_ehci_driver(void)
> +{
> +       platform_driver_unregister(&s5p_ehci_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_s5p_ehci_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_s5p_ehci_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
> index 937988a..74aed47 100644
> --- a/drivers/usb/host/ehci-sh.c
> +++ b/drivers/usb/host/ehci-sh.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_SH
>  /*
>  * SuperH EHCI host controller driver
>  *
> @@ -181,3 +182,23 @@ static struct platform_driver ehci_hcd_sh_driver = {
>  };
>
>  MODULE_ALIAS("platform:sh_ehci");
> +
> +static int ehci_register_ehci_hcd_sh_driver(void)
> +{
> +       return platform_driver_register(&ehci_hcd_sh_driver);
> +}
> +
> +static void ehci_unregister_ehci_hcd_sh_driver(void)
> +{
> +       platform_driver_unregister(&ehci_hcd_sh_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_hcd_sh_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_hcd_sh_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
> index c3a2d06..a71e50f 100644
> --- a/drivers/usb/host/ehci-spear.c
> +++ b/drivers/usb/host/ehci-spear.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_PLAT_SPEAR
>  /*
>  * Driver for EHCI HCD on SPEAR SOC
>  *
> @@ -146,3 +147,23 @@ static struct platform_driver spear_ehci_hcd_driver = {
>  };
>
>  MODULE_ALIAS("platform:spear-ehci");
> +
> +static int ehci_register_spear_ehci_hcd_driver(void)
> +{
> +       return platform_driver_register(&spear_ehci_hcd_driver);
> +}
> +
> +static void ehci_unregister_spear_ehci_hcd_driver(void)
> +{
> +       platform_driver_unregister(&spear_ehci_hcd_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_spear_ehci_hcd_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_spear_ehci_hcd_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
> index 02b2bfd..f752e4c 100644
> --- a/drivers/usb/host/ehci-tegra.c
> +++ b/drivers/usb/host/ehci-tegra.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_EHCI_TEGRA
>  /*
>  * EHCI-compliant USB host controller driver for NVIDIA Tegra SoCs
>  *
> @@ -785,3 +786,23 @@ static struct platform_driver tegra_ehci_driver = {
>                .name   = "tegra-ehci",
>        }
>  };
> +
> +static int ehci_register_tegra_ehci_driver(void)
> +{
> +       return platform_driver_register(&tegra_ehci_driver);
> +}
> +
> +static void ehci_unregister_tegra_ehci_driver(void)
> +{
> +       platform_driver_unregister(&tegra_ehci_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_tegra_ehci_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_tegra_ehci_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-vt8500.c b/drivers/usb/host/ehci-vt8500.c
> index 47d7496..103d6ad 100644
> --- a/drivers/usb/host/ehci-vt8500.c
> +++ b/drivers/usb/host/ehci-vt8500.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_ARCH_VT8500
>  /*
>  * drivers/usb/host/ehci-vt8500.c
>  *
> @@ -171,3 +172,23 @@ static struct platform_driver vt8500_ehci_driver = {
>  };
>
>  MODULE_ALIAS("platform:vt8500-ehci");
> +
> +static int ehci_register_vt8500_ehci_driver(void)
> +{
> +       return platform_driver_register(&vt8500_ehci_driver);
> +}
> +
> +static void ehci_unregister_vt8500_ehci_driver(void)
> +{
> +       platform_driver_unregister(&vt8500_ehci_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_vt8500_ehci_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_vt8500_ehci_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
> index d661cf7..44e292f 100644
> --- a/drivers/usb/host/ehci-w90x900.c
> +++ b/drivers/usb/host/ehci-w90x900.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_USB_W90X900_EHCI
>  /*
>  * linux/driver/usb/host/ehci-w90x900.c
>  *
> @@ -182,3 +183,23 @@ MODULE_AUTHOR("Wan ZongShun <mcuos.com@xxxxxxxxx>");
>  MODULE_DESCRIPTION("w90p910 usb ehci driver!");
>  MODULE_LICENSE("GPL");
>  MODULE_ALIAS("platform:w90p910-ehci");
> +
> +static int ehci_register_ehci_hcd_w90x900_driver(void)
> +{
> +       return platform_driver_register(&ehci_hcd_w90x900_driver);
> +}
> +
> +static void ehci_unregister_ehci_hcd_w90x900_driver(void)
> +{
> +       platform_driver_unregister(&ehci_hcd_w90x900_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_hcd_w90x900_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_hcd_w90x900_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci-xls.c b/drivers/usb/host/ehci-xls.c
> index fe74bd6..9e048a0 100644
> --- a/drivers/usb/host/ehci-xls.c
> +++ b/drivers/usb/host/ehci-xls.c
> @@ -1,3 +1,4 @@
> +#ifdef CONFIG_NLM_XLR
>  /*
>  * EHCI HCD for Netlogic XLS processors.
>  *
> @@ -159,3 +160,23 @@ static struct platform_driver ehci_xls_driver = {
>                .name = "ehci-xls",
>        },
>  };
> +
> +static int ehci_register_ehci_xls_driver(void)
> +{
> +       return platform_driver_register(&ehci_xls_driver);
> +}
> +
> +static void ehci_unregister_ehci_xls_driver(void)
> +{
> +       platform_driver_unregister(&ehci_xls_driver);
> +}
> +
> +#else
> +
> +static int ehci_register_ehci_xls_driver(void)
> +{
> +       return 0;
> +}
> +
> +static void ehci_unregister_ehci_xls_driver(void) {}
> +#endif
> diff --git a/drivers/usb/host/ehci.c b/drivers/usb/host/ehci.c
> index 42c02a5..2e91434 100644
> --- a/drivers/usb/host/ehci.c
> +++ b/drivers/usb/host/ehci.c
> @@ -1166,117 +1166,6 @@ MODULE_DESCRIPTION(DRIVER_DESC);
>  MODULE_AUTHOR (DRIVER_AUTHOR);
>  MODULE_LICENSE ("GPL");
>
> -#ifdef CONFIG_USB_EHCI_FSL
> -#include "ehci-fsl.c"
> -#define        PLATFORM_DRIVER         ehci_fsl_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_MXC
> -#include "ehci-mxc.c"
> -#define PLATFORM_DRIVER                ehci_mxc_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_SH
> -#include "ehci-sh.c"
> -#define PLATFORM_DRIVER                ehci_hcd_sh_driver
> -#endif
> -
> -#ifdef CONFIG_SOC_AU1200
> -#include "ehci-au1xxx.c"
> -#define        PLATFORM_DRIVER         ehci_hcd_au1xxx_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_HCD_OMAP
> -#include "ehci-omap.c"
> -#define        PLATFORM_DRIVER         ehci_hcd_omap_driver
> -#endif
> -
> -#ifdef CONFIG_PLAT_ORION
> -#include "ehci-orion.c"
> -#define        PLATFORM_DRIVER         ehci_orion_driver
> -#endif
> -
> -#ifdef CONFIG_ARCH_IXP4XX
> -#include "ehci-ixp4xx.c"
> -#define        PLATFORM_DRIVER         ixp4xx_ehci_driver
> -#endif
> -
> -#ifdef CONFIG_USB_W90X900_EHCI
> -#include "ehci-w90x900.c"
> -#define        PLATFORM_DRIVER         ehci_hcd_w90x900_driver
> -#endif
> -
> -#ifdef CONFIG_ARCH_AT91
> -#include "ehci-atmel.c"
> -#define        PLATFORM_DRIVER         ehci_atmel_driver
> -#endif
> -
> -#ifdef CONFIG_USB_OCTEON_EHCI
> -#include "ehci-octeon.c"
> -#define PLATFORM_DRIVER                ehci_octeon_driver
> -#endif
> -
> -#ifdef CONFIG_USB_CNS3XXX_EHCI
> -#include "ehci-cns3xxx.c"
> -#define PLATFORM_DRIVER                cns3xxx_ehci_driver
> -#endif
> -
> -#ifdef CONFIG_ARCH_VT8500
> -#include "ehci-vt8500.c"
> -#define        PLATFORM_DRIVER         vt8500_ehci_driver
> -#endif
> -
> -#ifdef CONFIG_PLAT_SPEAR
> -#include "ehci-spear.c"
> -#define PLATFORM_DRIVER                spear_ehci_hcd_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_MSM
> -#include "ehci-msm.c"
> -#define PLATFORM_DRIVER                ehci_msm_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_HCD_PMC_MSP
> -#include "ehci-pmcmsp.c"
> -#define        PLATFORM_DRIVER         ehci_hcd_msp_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_TEGRA
> -#include "ehci-tegra.c"
> -#define PLATFORM_DRIVER                tegra_ehci_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_S5P
> -#include "ehci-s5p.c"
> -#define PLATFORM_DRIVER                s5p_ehci_driver
> -#endif
> -
> -#ifdef CONFIG_USB_EHCI_ATH79
> -#include "ehci-ath79.c"
> -#define PLATFORM_DRIVER                ehci_ath79_driver
> -#endif
> -
> -#ifdef CONFIG_SPARC_LEON
> -#include "ehci-grlib.c"
> -#define PLATFORM_DRIVER                ehci_grlib_driver
> -#endif
> -
> -#ifdef CONFIG_USB_PXA168_EHCI
> -#include "ehci-pxa168.c"
> -#define PLATFORM_DRIVER                ehci_pxa168_driver
> -#endif
> -
> -#ifdef CONFIG_NLM_XLR
> -#include "ehci-xls.c"
> -#define PLATFORM_DRIVER                ehci_xls_driver
> -#endif
> -
> -#if !defined(CONFIG_PCI) && !defined(PLATFORM_DRIVER) && \
> -    !defined(CONFIG_PPC_PS3) && !defined(CONFIG_USB_EHCI_HCD_PPC_OF) && \
> -    !defined(CONFIG_XPS_USB_HCD_XILINX)
> -#error "missing bus glue for ehci-hcd"
> -#endif
> -
>  static int __init ehci_hcd_init(void)
>  {
>        int retval = 0;
> @@ -1304,11 +1193,9 @@ static int __init ehci_hcd_init(void)
>        }
>  #endif
>
> -#ifdef PLATFORM_DRIVER
> -       retval = platform_driver_register(&PLATFORM_DRIVER);
> +       retval = ehci_register_platforms();
>        if (retval < 0)
>                goto clean0;
> -#endif
>
>        retval = ehci_register_pci();
>        if (retval < 0)
> @@ -1335,10 +1222,8 @@ clean3:
>  clean2:
>        ehci_unregister_pci();
>  clean1:
> -#ifdef PLATFORM_DRIVER
> -       platform_driver_unregister(&PLATFORM_DRIVER);
> +       ehci_unregister_platforms();
>  clean0:
> -#endif
>  #ifdef DEBUG
>        debugfs_remove(ehci_debug_root);
>        ehci_debug_root = NULL;
> @@ -1353,9 +1238,7 @@ static void __exit ehci_hcd_cleanup(void)
>  {
>        ehci_xilinx_of_unregister();
>        ehci_ppc_of_unregister();
> -#ifdef PLATFORM_DRIVER
> -       platform_driver_unregister(&PLATFORM_DRIVER);
> -#endif
> +       ehci_unregister_platforms();
>        ehci_unregister_pci();
>        ehci_ps3_unregister();
>  #ifdef DEBUG
> diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
> index bde996d..50cc09d 100644
> --- a/drivers/usb/host/ehci.h
> +++ b/drivers/usb/host/ehci.h
> @@ -825,6 +825,9 @@ static inline int ehci_xilinx_of_register(void) { return 0; }
>  static inline void ehci_xilinx_of_unregister(void) {};
>  #endif
>
> +int ehci_register_platforms(void);
> +void ehci_unregister_platforms(void);
> +
>  /*-------------------------------------------------------------------------*/
>
>  #ifndef DEBUG
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux