diff mbox series

[v11,net-next,3/9] pinctrl: ocelot: allow pinctrl-ocelot to be loaded as a module

Message ID 20220628081709.829811-4-colin.foster@in-advantage.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series add support for VSC7512 control over SPI | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers success CCed 2 of 2 maintainers
netdev/build_clang success Errors and warnings before: 6 this patch: 6
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Colin Foster June 28, 2022, 8:17 a.m. UTC
Work is being done to allow external control of Ocelot chips. When pinctrl
drivers are used internally, it wouldn't make much sense to allow them to
be loaded as modules. In the case where the Ocelot chip is controlled
externally, this scenario becomes practical.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/pinctrl/Kconfig          | 2 +-
 drivers/pinctrl/pinctrl-ocelot.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Andy Shevchenko June 28, 2022, 12:53 p.m. UTC | #1
On Tue, Jun 28, 2022 at 10:17 AM Colin Foster
<colin.foster@in-advantage.com> wrote:
>
> Work is being done to allow external control of Ocelot chips. When pinctrl
> drivers are used internally, it wouldn't make much sense to allow them to
> be loaded as modules. In the case where the Ocelot chip is controlled
> externally, this scenario becomes practical.

...

>  builtin_platform_driver(ocelot_pinctrl_driver);

This contradicts the logic behind this change. Perhaps you need to
move to module_platform_driver(). (Yes, I think functionally it won't
be any changes if ->remove() is not needed, but for the sake of
logical correctness...)
Colin Foster June 28, 2022, 6:25 p.m. UTC | #2
Hi Andy,

On Tue, Jun 28, 2022 at 02:53:49PM +0200, Andy Shevchenko wrote:
> On Tue, Jun 28, 2022 at 10:17 AM Colin Foster
> <colin.foster@in-advantage.com> wrote:
> >
> > Work is being done to allow external control of Ocelot chips. When pinctrl
> > drivers are used internally, it wouldn't make much sense to allow them to
> > be loaded as modules. In the case where the Ocelot chip is controlled
> > externally, this scenario becomes practical.
> 
> ...
> 
> >  builtin_platform_driver(ocelot_pinctrl_driver);
> 
> This contradicts the logic behind this change. Perhaps you need to
> move to module_platform_driver(). (Yes, I think functionally it won't
> be any changes if ->remove() is not needed, but for the sake of
> logical correctness...)

I'll do this. Thanks.

Process question: If I make this change is it typical to remove all
Reviewed-By tags? I assume "yes"

> 
> -- 
> With Best Regards,
> Andy Shevchenko
Andy Shevchenko June 28, 2022, 7 p.m. UTC | #3
On Tue, Jun 28, 2022 at 8:25 PM Colin Foster
<colin.foster@in-advantage.com> wrote:
> On Tue, Jun 28, 2022 at 02:53:49PM +0200, Andy Shevchenko wrote:
> > On Tue, Jun 28, 2022 at 10:17 AM Colin Foster
> > <colin.foster@in-advantage.com> wrote:

...

> > >  builtin_platform_driver(ocelot_pinctrl_driver);
> >
> > This contradicts the logic behind this change. Perhaps you need to
> > move to module_platform_driver(). (Yes, I think functionally it won't
> > be any changes if ->remove() is not needed, but for the sake of
> > logical correctness...)
>
> I'll do this. Thanks.
>
> Process question: If I make this change is it typical to remove all
> Reviewed-By tags? I assume "yes"

I would not. This change is logical continuation and I truly believe
every reviewer will agree on it.
Linus Walleij June 30, 2022, 11:56 a.m. UTC | #4
On Tue, Jun 28, 2022 at 9:00 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Jun 28, 2022 at 8:25 PM Colin Foster
> <colin.foster@in-advantage.com> wrote:
> > On Tue, Jun 28, 2022 at 02:53:49PM +0200, Andy Shevchenko wrote:
> > > On Tue, Jun 28, 2022 at 10:17 AM Colin Foster
> > > <colin.foster@in-advantage.com> wrote:
>
> ...
>
> > > >  builtin_platform_driver(ocelot_pinctrl_driver);
> > >
> > > This contradicts the logic behind this change. Perhaps you need to
> > > move to module_platform_driver(). (Yes, I think functionally it won't
> > > be any changes if ->remove() is not needed, but for the sake of
> > > logical correctness...)
> >
> > I'll do this. Thanks.
> >
> > Process question: If I make this change is it typical to remove all
> > Reviewed-By tags? I assume "yes"
>
> I would not. This change is logical continuation and I truly believe
> every reviewer will agree on it.

I would have to think hard to remember a single review comment from Andy
where I didn't think "ah, yeah he's right", so definately keep mine.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index f52960d2dfbe..257b06752747 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -311,7 +311,7 @@  config PINCTRL_MICROCHIP_SGPIO
 	  LED controller.
 
 config PINCTRL_OCELOT
-	bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
+	tristate "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
 	depends on OF
 	depends on HAS_IOMEM
 	select GPIOLIB
diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index 5f4a8c5c6650..5554c3014448 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -1889,6 +1889,7 @@  static const struct of_device_id ocelot_pinctrl_of_match[] = {
 	{ .compatible = "microchip,lan966x-pinctrl", .data = &lan966x_desc },
 	{},
 };
+MODULE_DEVICE_TABLE(of, ocelot_pinctrl_of_match);
 
 static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev)
 {
@@ -1985,3 +1986,6 @@  static struct platform_driver ocelot_pinctrl_driver = {
 	.probe = ocelot_pinctrl_probe,
 };
 builtin_platform_driver(ocelot_pinctrl_driver);
+
+MODULE_DESCRIPTION("Ocelot Chip Pinctrl Driver");
+MODULE_LICENSE("Dual MIT/GPL");