All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: imx_keypad - convert to a DT-only driver
@ 2021-03-15 17:10 Fabio Estevam
  2021-03-16  1:48 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2021-03-15 17:10 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, Fabio Estevam

i.MX has been converted to a DT-only platform, so make the driver
depend on OF, remove the CONFIG_OF ifdefery and remove of_match_ptr().

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/input/keyboard/Kconfig      | 1 +
 drivers/input/keyboard/imx_keypad.c | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 32d15809ae58..bef0c06ef2a9 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -458,6 +458,7 @@ config KEYBOARD_SNVS_PWRKEY
 config KEYBOARD_IMX
 	tristate "IMX keypad support"
 	depends on ARCH_MXC || COMPILE_TEST
+	depends on OF
 	select INPUT_MATRIXKMAP
 	help
 	  Enable support for IMX keypad port.
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 1f5c9ea5e9e5..815b3d11dfbb 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -408,13 +408,11 @@ static int imx_keypad_open(struct input_dev *dev)
 	return -EIO;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id imx_keypad_of_match[] = {
 	{ .compatible = "fsl,imx21-kpp", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, imx_keypad_of_match);
-#endif
 
 static int imx_keypad_probe(struct platform_device *pdev)
 {
@@ -582,7 +580,7 @@ static struct platform_driver imx_keypad_driver = {
 	.driver		= {
 		.name	= "imx-keypad",
 		.pm	= &imx_kbd_pm_ops,
-		.of_match_table = of_match_ptr(imx_keypad_of_match),
+		.of_match_table = imx_keypad_of_match,
 	},
 	.probe		= imx_keypad_probe,
 };
-- 
2.25.1


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

* Re: [PATCH] Input: imx_keypad - convert to a DT-only driver
  2021-03-15 17:10 [PATCH] Input: imx_keypad - convert to a DT-only driver Fabio Estevam
@ 2021-03-16  1:48 ` Dmitry Torokhov
  2021-03-16 13:35   ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2021-03-16  1:48 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-input

Hi Fabio,

On Mon, Mar 15, 2021 at 02:10:37PM -0300, Fabio Estevam wrote:
> i.MX has been converted to a DT-only platform, so make the driver
> depend on OF, remove the CONFIG_OF ifdefery and remove of_match_ptr().
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/input/keyboard/Kconfig      | 1 +
>  drivers/input/keyboard/imx_keypad.c | 4 +---
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index 32d15809ae58..bef0c06ef2a9 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -458,6 +458,7 @@ config KEYBOARD_SNVS_PWRKEY
>  config KEYBOARD_IMX
>  	tristate "IMX keypad support"
>  	depends on ARCH_MXC || COMPILE_TEST
> +	depends on OF

ARCH_MXC is a stronger constraint than OF, so I wonder if we really need
this.

>  	select INPUT_MATRIXKMAP
>  	help
>  	  Enable support for IMX keypad port.
> diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
> index 1f5c9ea5e9e5..815b3d11dfbb 100644
> --- a/drivers/input/keyboard/imx_keypad.c
> +++ b/drivers/input/keyboard/imx_keypad.c
> @@ -408,13 +408,11 @@ static int imx_keypad_open(struct input_dev *dev)
>  	return -EIO;
>  }
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id imx_keypad_of_match[] = {
>  	{ .compatible = "fsl,imx21-kpp", },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, imx_keypad_of_match);
> -#endif
>  
>  static int imx_keypad_probe(struct platform_device *pdev)
>  {
> @@ -582,7 +580,7 @@ static struct platform_driver imx_keypad_driver = {
>  	.driver		= {
>  		.name	= "imx-keypad",
>  		.pm	= &imx_kbd_pm_ops,
> -		.of_match_table = of_match_ptr(imx_keypad_of_match),
> +		.of_match_table = imx_keypad_of_match,
>  	},
>  	.probe		= imx_keypad_probe,
>  };

If we truly converting this driver then we should also remove references
to dev_get_platdata() and checks for pdev->dev.of_node from
imx_keypad_probe.

Thanks.

-- 
Dmitry

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

* Re: [PATCH] Input: imx_keypad - convert to a DT-only driver
  2021-03-16  1:48 ` Dmitry Torokhov
@ 2021-03-16 13:35   ` Fabio Estevam
  0 siblings, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2021-03-16 13:35 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

Hi Dmitry,

On Mon, Mar 15, 2021 at 10:48 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> > @@ -458,6 +458,7 @@ config KEYBOARD_SNVS_PWRKEY
> >  config KEYBOARD_IMX
> >       tristate "IMX keypad support"
> >       depends on ARCH_MXC || COMPILE_TEST
> > +     depends on OF
>
> ARCH_MXC is a stronger constraint than OF, so I wonder if we really need
> this.

ARCH_MXC does not depend on OF yet, but I agree this is a good
suggestion and will submit a patch to do so.

For the time being, I will keep the OF dependency in the driver.

> If we truly converting this driver then we should also remove references
> to dev_get_platdata() and checks for pdev->dev.of_node from
> imx_keypad_probe.

Good point. I removed them in v2.

Thanks

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

end of thread, other threads:[~2021-03-16 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 17:10 [PATCH] Input: imx_keypad - convert to a DT-only driver Fabio Estevam
2021-03-16  1:48 ` Dmitry Torokhov
2021-03-16 13:35   ` Fabio Estevam

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.