netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
To: Nicolas Frayer <nfrayer@baylibre.com>,
	nm@ti.com, ssantosh@kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, vkoul@kernel.org,
	dmaengine@vger.kernel.org, grygorii.strashko@ti.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, linux-omap@vger.kernel.org,
	netdev@vger.kernel.org
Cc: khilman@baylibre.com, glaroque@baylibre.com
Subject: Re: [PATCH v4 2/4] soc: ti: Add module build support
Date: Thu, 24 Nov 2022 09:54:12 +0200	[thread overview]
Message-ID: <7775f7ff-b297-eeab-dd46-e7ac5e1c14fb@gmail.com> (raw)
In-Reply-To: <20221108181144.433087-3-nfrayer@baylibre.com>



On 08/11/2022 20:11, Nicolas Frayer wrote:
> Added module build support for the TI K3 SoC info driver.

Subject: "soc: ti: k3-socinfo: ..."

> 
> Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
> ---
>   arch/arm64/Kconfig.platforms |  1 -
>   drivers/soc/ti/Kconfig       |  3 ++-
>   drivers/soc/ti/k3-socinfo.c  | 11 +++++++++++
>   3 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 76580b932e44..4f2f92eb499f 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -130,7 +130,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 7e2fb1c16af1..1a730c057cce 100644
> --- a/drivers/soc/ti/Kconfig
> +++ b/drivers/soc/ti/Kconfig
> @@ -74,7 +74,8 @@ config TI_K3_RINGACC
>   	  If unsure, say N.
>   
>   config TI_K3_SOCINFO
> -	bool
> +	tristate "TI K3 SoC info driver"
> +	default y

Why it is a good thing to have this driver as module compared to always 
built in?
It has no dependencies, just things depending on it.
It is small, just couple of lines long

I don't really see the benefit of building it as a module, not even an 
academic one...


>   	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 19f3e74f5376..98348f998e0f 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
>   /*
> @@ -141,6 +142,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 = {
> @@ -156,3 +158,12 @@ static int __init k3_chipinfo_init(void)
>   	return platform_driver_register(&k3_chipinfo_driver);
>   }
>   subsys_initcall(k3_chipinfo_init);

subsys_initcall for a module?

> +
> +static void __exit k3_chipinfo_exit(void)
> +{
> +	platform_driver_unregister(&k3_chipinfo_driver);
> +}
> +module_exit(k3_chipinfo_exit);
> +
> +MODULE_DESCRIPTION("TI K3 SoC info driver");
> +MODULE_LICENSE("GPL");

-- 
Péter

  parent reply	other threads:[~2022-11-24  7:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 18:11 [PATCH v4 0/4] soc: ti: Add module build support to the socinfo Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 1/4] soc: ti: Convert allocations to devm Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 2/4] soc: ti: Add module build support Nicolas Frayer
2022-11-08 18:18   ` Randy Dunlap
2022-11-24  9:04     ` Nicolas Frayer
2022-11-24  7:54   ` Péter Ujfalusi [this message]
2022-11-24  9:01     ` Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 3/4] dmaengine: ti: k3-udma: Deferring probe when soc_device_match() returns NULL Nicolas Frayer
2022-11-08 18:11 ` [PATCH v4 4/4] net: ethernet: ti: davinci_mdio: " Nicolas Frayer
2022-11-10 11:21   ` Paolo Abeni
2022-11-16 10:52     ` Nicolas Frayer
2022-11-23 15:59   ` Vignesh Raghavendra
2022-11-23 17:33     ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7775f7ff-b297-eeab-dd46-e7ac5e1c14fb@gmail.com \
    --to=peter.ujfalusi@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dmaengine@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=glaroque@baylibre.com \
    --cc=grygorii.strashko@ti.com \
    --cc=khilman@baylibre.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nfrayer@baylibre.com \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=ssantosh@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).