linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: tegra: Use device_get_match_data()
@ 2023-10-06 22:44 Rob Herring
  2023-10-11 20:24 ` Thierry Reding
  2023-10-14  3:09 ` Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring @ 2023-10-06 22:44 UTC (permalink / raw)
  To: Laxman Dewangan, Dmitry Torokhov, Thierry Reding, Jonathan Hunter
  Cc: linux-input, linux-tegra, linux-kernel

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/input/keyboard/tegra-kbc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index c9a823ea45d0..a1765ed8c825 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -14,7 +14,7 @@
 #include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/property.h>
 #include <linux/clk.h>
 #include <linux/slab.h>
 #include <linux/input/matrix_keypad.h>
@@ -602,9 +602,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
 	unsigned int debounce_cnt;
 	unsigned int scan_time_rows;
 	unsigned int keymap_rows;
-	const struct of_device_id *match;
-
-	match = of_match_device(tegra_kbc_of_match, &pdev->dev);
 
 	kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
 	if (!kbc) {
@@ -613,7 +610,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
 	}
 
 	kbc->dev = &pdev->dev;
-	kbc->hw_support = match->data;
+	kbc->hw_support = device_get_match_data(&pdev->dev);
 	kbc->max_keys = kbc->hw_support->max_rows *
 				kbc->hw_support->max_columns;
 	kbc->num_rows_and_columns = kbc->hw_support->max_rows +
-- 
2.40.1


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

* Re: [PATCH] Input: tegra: Use device_get_match_data()
  2023-10-06 22:44 [PATCH] Input: tegra: Use device_get_match_data() Rob Herring
@ 2023-10-11 20:24 ` Thierry Reding
  2023-10-14  3:09 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2023-10-11 20:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: Laxman Dewangan, Dmitry Torokhov, Jonathan Hunter, linux-input,
	linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

On Fri, Oct 06, 2023 at 05:44:32PM -0500, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/input/keyboard/tegra-kbc.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] Input: tegra: Use device_get_match_data()
  2023-10-06 22:44 [PATCH] Input: tegra: Use device_get_match_data() Rob Herring
  2023-10-11 20:24 ` Thierry Reding
@ 2023-10-14  3:09 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2023-10-14  3:09 UTC (permalink / raw)
  To: Rob Herring
  Cc: Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-input,
	linux-tegra, linux-kernel

On Fri, Oct 06, 2023 at 05:44:32PM -0500, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2023-10-14  3:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06 22:44 [PATCH] Input: tegra: Use device_get_match_data() Rob Herring
2023-10-11 20:24 ` Thierry Reding
2023-10-14  3:09 ` Dmitry Torokhov

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).