All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: vf610: connect GPIO label to dev name
@ 2022-12-20  9:02 haibo.chen
  2022-12-20  9:02 ` [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module haibo.chen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: haibo.chen @ 2022-12-20  9:02 UTC (permalink / raw)
  To: linus.walleij, brgl
  Cc: stefan, linux-gpio, linux-imx, haibo.chen, linux-kernel

From: Haibo Chen <haibo.chen@nxp.com>

Current GPIO label is fixed, so can't distinguish different GPIO
controllers through labels. Use dev name instead.

Fixes: 7f2691a19627 ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid")
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/gpio/gpio-vf610.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 9db42f6a2043..a429176673e7 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -304,7 +304,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 
 	gc = &port->gc;
 	gc->parent = dev;
-	gc->label = "vf610-gpio";
+	gc->label = dev_name(dev);
 	gc->ngpio = VF610_GPIO_PER_PORT;
 	gc->base = of_alias_get_id(np, "gpio") * VF610_GPIO_PER_PORT;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module
  2022-12-20  9:02 [PATCH 1/2] gpio: vf610: connect GPIO label to dev name haibo.chen
@ 2022-12-20  9:02 ` haibo.chen
  2022-12-29  1:46   ` Linus Walleij
  2022-12-29  1:43 ` [PATCH 1/2] gpio: vf610: connect GPIO label to dev name Linus Walleij
  2023-01-02  8:03 ` Bartosz Golaszewski
  2 siblings, 1 reply; 7+ messages in thread
From: haibo.chen @ 2022-12-20  9:02 UTC (permalink / raw)
  To: linus.walleij, brgl
  Cc: stefan, linux-gpio, linux-imx, haibo.chen, linux-kernel

From: Haibo Chen <haibo.chen@nxp.com>

To support Android GKI, need to build this driver as module.
So change the config as tristate type, and add module license.

Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/gpio/Kconfig      | 3 ++-
 drivers/gpio/gpio-vf610.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index ec7cfd4f52b1..53c35cc0ff73 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -680,7 +680,8 @@ config GPIO_UNIPHIER
 	  Say yes here to support UniPhier GPIOs.
 
 config GPIO_VF610
-	def_bool y
+	tristate "Vybrid vf610 GPIO support"
+	default y if ARCH_MXC
 	depends on ARCH_MXC
 	select GPIOLIB_IRQCHIP
 	help
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index a429176673e7..942932ce825a 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/ioport.h>
 #include <linux/irq.h>
+#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -355,3 +356,4 @@ static struct platform_driver vf610_gpio_driver = {
 };
 
 builtin_platform_driver(vf610_gpio_driver);
+MODULE_LICENSE("GPL");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] gpio: vf610: connect GPIO label to dev name
  2022-12-20  9:02 [PATCH 1/2] gpio: vf610: connect GPIO label to dev name haibo.chen
  2022-12-20  9:02 ` [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module haibo.chen
@ 2022-12-29  1:43 ` Linus Walleij
  2023-01-02  8:03 ` Bartosz Golaszewski
  2 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2022-12-29  1:43 UTC (permalink / raw)
  To: haibo.chen; +Cc: brgl, stefan, linux-gpio, linux-imx, linux-kernel

On Tue, Dec 20, 2022 at 10:02 AM <haibo.chen@nxp.com> wrote:

> From: Haibo Chen <haibo.chen@nxp.com>
>
> Current GPIO label is fixed, so can't distinguish different GPIO
> controllers through labels. Use dev name instead.
>
> Fixes: 7f2691a19627 ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid")
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module
  2022-12-20  9:02 ` [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module haibo.chen
@ 2022-12-29  1:46   ` Linus Walleij
  2023-01-17 14:01     ` Bough Chen
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2022-12-29  1:46 UTC (permalink / raw)
  To: haibo.chen; +Cc: brgl, stefan, linux-gpio, linux-imx, linux-kernel

On Tue, Dec 20, 2022 at 10:02 AM <haibo.chen@nxp.com> wrote:

> From: Haibo Chen <haibo.chen@nxp.com>
>
> To support Android GKI, need to build this driver as module.
> So change the config as tristate type, and add module license.
>
> Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>

OK...

>  builtin_platform_driver(vf610_gpio_driver);

Then you want something like module_platform_driver() here.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] gpio: vf610: connect GPIO label to dev name
  2022-12-20  9:02 [PATCH 1/2] gpio: vf610: connect GPIO label to dev name haibo.chen
  2022-12-20  9:02 ` [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module haibo.chen
  2022-12-29  1:43 ` [PATCH 1/2] gpio: vf610: connect GPIO label to dev name Linus Walleij
@ 2023-01-02  8:03 ` Bartosz Golaszewski
  2 siblings, 0 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2023-01-02  8:03 UTC (permalink / raw)
  To: haibo.chen; +Cc: linus.walleij, stefan, linux-gpio, linux-imx, linux-kernel

On Tue, Dec 20, 2022 at 10:02 AM <haibo.chen@nxp.com> wrote:
>
> From: Haibo Chen <haibo.chen@nxp.com>
>
> Current GPIO label is fixed, so can't distinguish different GPIO
> controllers through labels. Use dev name instead.
>
> Fixes: 7f2691a19627 ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid")
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> ---
>  drivers/gpio/gpio-vf610.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
> index 9db42f6a2043..a429176673e7 100644
> --- a/drivers/gpio/gpio-vf610.c
> +++ b/drivers/gpio/gpio-vf610.c
> @@ -304,7 +304,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
>
>         gc = &port->gc;
>         gc->parent = dev;
> -       gc->label = "vf610-gpio";
> +       gc->label = dev_name(dev);
>         gc->ngpio = VF610_GPIO_PER_PORT;
>         gc->base = of_alias_get_id(np, "gpio") * VF610_GPIO_PER_PORT;
>
> --
> 2.34.1
>

I applied this one, please fix patch 2/2 and resend on its own.

Bartosz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module
  2022-12-29  1:46   ` Linus Walleij
@ 2023-01-17 14:01     ` Bough Chen
  2023-01-17 14:12       ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Bough Chen @ 2023-01-17 14:01 UTC (permalink / raw)
  To: Linus Walleij; +Cc: brgl, stefan, linux-gpio, dl-linux-imx, linux-kernel

> -----Original Message-----
> From: Linus Walleij <linus.walleij@linaro.org>
> Sent: 2022年12月29日 9:46
> To: Bough Chen <haibo.chen@nxp.com>
> Cc: brgl@bgdev.pl; stefan@agner.ch; linux-gpio@vger.kernel.org; dl-linux-imx
> <linux-imx@nxp.com>; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as
> module
> 
> On Tue, Dec 20, 2022 at 10:02 AM <haibo.chen@nxp.com> wrote:
> 
> > From: Haibo Chen <haibo.chen@nxp.com>
> >
> > To support Android GKI, need to build this driver as module.
> > So change the config as tristate type, and add module license.
> >
> > Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
> > Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> 
> OK...
> 
> >  builtin_platform_driver(vf610_gpio_driver);
> 
> Then you want something like module_platform_driver() here.

Hi Linus,

Here, though need to build this gpio driver as module due to the Android GKI, but we do not really need to 
rmmod/unbind this driver, so do not need to implement the _exit or remove callback. 
In this case, still need to change to module_platform_driver()? 
If so, after use the module_platform_driver(), is it okay to not implement the __exit /remove callback?

Best Regards
Haibo Chen
> 
> Yours,
> Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module
  2023-01-17 14:01     ` Bough Chen
@ 2023-01-17 14:12       ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2023-01-17 14:12 UTC (permalink / raw)
  To: Bough Chen; +Cc: brgl, stefan, linux-gpio, dl-linux-imx, linux-kernel

On Tue, Jan 17, 2023 at 3:01 PM Bough Chen <haibo.chen@nxp.com> wrote:
> > On Tue, Dec 20, 2022 at 10:02 AM <haibo.chen@nxp.com> wrote:
> >
> > > From: Haibo Chen <haibo.chen@nxp.com>
> > >
> > > To support Android GKI, need to build this driver as module.
> > > So change the config as tristate type, and add module license.
> > >
> > > Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
> > > Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
> >
> > OK...
> >
> > >  builtin_platform_driver(vf610_gpio_driver);
> >
> > Then you want something like module_platform_driver() here.
>
> Hi Linus,
>
> Here, though need to build this gpio driver as module due to the Android GKI, but we do not really need to
> rmmod/unbind this driver, so do not need to implement the _exit or remove callback.
> In this case, still need to change to module_platform_driver()?
> If so, after use the module_platform_driver(), is it okay to not implement the __exit /remove callback?

Yes, our project is about maintaining and improving the Linux kernel, GKI
is not a project we are running. If they need stuff from Linux, it happens on
our terms, and that is that modularization should be self-motivated.

Check this article:
https://lwn.net/Articles/872209/

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-17 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20  9:02 [PATCH 1/2] gpio: vf610: connect GPIO label to dev name haibo.chen
2022-12-20  9:02 ` [PATCH 2/2] gpio: vf610: Support building gpio-vf610 driver as module haibo.chen
2022-12-29  1:46   ` Linus Walleij
2023-01-17 14:01     ` Bough Chen
2023-01-17 14:12       ` Linus Walleij
2022-12-29  1:43 ` [PATCH 1/2] gpio: vf610: connect GPIO label to dev name Linus Walleij
2023-01-02  8:03 ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.