[PATCH v2 2/2] soc: ti: Add module build support

Nicolas Frayer nfrayer at baylibre.com
Mon Oct 10 09:40:27 PDT 2022


Le lun. 10 oct. 2022 à 15:15, Nicolas Frayer <nfrayer at baylibre.com> a écrit :
>
> Added module build support for the TI K3 SoC info driver.
>
> Signed-off-by: Nicolas Frayer <nfrayer at baylibre.com>
> ---
>  arch/arm64/Kconfig.platforms |  1 -
>  drivers/soc/ti/Kconfig       |  3 ++-
>  drivers/soc/ti/k3-socinfo.c  | 11 ++++++-----
>  3 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 889e78f40a25..31b628fdd4b1 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -112,7 +112,6 @@ config ARCH_K3
>         select TI_SCI_PROTOCOL
>         select TI_SCI_INTR_IRQCHIP
>         select TI_SCI_INTA_IRQCHIP
> -       select TI_K3_SOCINFO
>         help
>           This enables support for Texas Instruments' K3 multicore SoC
>           architecture.
> diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
> index 56c41eac33f8..a10bea0cdf90 100644
> --- a/drivers/soc/ti/Kconfig
> +++ b/drivers/soc/ti/Kconfig
> @@ -85,7 +85,8 @@ config TI_K3_RINGACC
>           If unsure, say N.
>
>  config TI_K3_SOCINFO
> -       bool
> +       tristate "TI K3 SoC info driver"
> +       default y
>         depends on ARCH_K3 || COMPILE_TEST
>         select SOC_BUS
>         select MFD_SYSCON
> diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c
> index 3311797145ed..dd275f338e06 100644
> --- a/drivers/soc/ti/k3-socinfo.c
> +++ b/drivers/soc/ti/k3-socinfo.c
> @@ -13,6 +13,7 @@
>  #include <linux/slab.h>
>  #include <linux/string.h>
>  #include <linux/sys_soc.h>
> +#include <linux/module.h>
>
>  #define CTRLMMR_WKUP_JTAGID_REG                0
>  /*
> @@ -142,6 +143,7 @@ static const struct of_device_id k3_chipinfo_of_match[] = {
>         { .compatible = "ti,am654-chipid", },
>         { /* sentinel */ },
>  };
> +MODULE_DEVICE_TABLE(of, k3_chipinfo_of_match);
>
>  static struct platform_driver k3_chipinfo_driver = {
>         .driver = {
> @@ -152,8 +154,7 @@ static struct platform_driver k3_chipinfo_driver = {
>         .remove = k3_chipinfo_remove,
>  };
>
> -static int __init k3_chipinfo_init(void)
> -{
> -       return platform_driver_register(&k3_chipinfo_driver);
> -}
> -subsys_initcall(k3_chipinfo_init);
> +module_platform_driver(k3_chipinfo_driver);
> +
> +MODULE_DESCRIPTION("TI K3 SoC info driver");
> +MODULE_LICENSE("GPL v2");
> --
> 2.25.1
>
[Resending without the HTML formatting]
Please do not merge this patch. A dependency issue is introduced by
changing subsys_initcall() to module_platform_driver().
Some drivers using the socinfo information probe before the socinfo
driver itself and it makes their probes fail.
However, the first patch of this serie can be merged.



More information about the linux-arm-kernel mailing list