Skip to content

Commit 6cd2566

Browse files
robherringdtor
authored andcommitted
Input: tegra-kbc - use device_get_match_data()
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 <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 787650c commit 6cd2566

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/input/keyboard/tegra-kbc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/io.h>
1515
#include <linux/interrupt.h>
1616
#include <linux/of.h>
17-
#include <linux/of_device.h>
17+
#include <linux/property.h>
1818
#include <linux/clk.h>
1919
#include <linux/slab.h>
2020
#include <linux/input/matrix_keypad.h>
@@ -602,9 +602,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
602602
unsigned int debounce_cnt;
603603
unsigned int scan_time_rows;
604604
unsigned int keymap_rows;
605-
const struct of_device_id *match;
606-
607-
match = of_match_device(tegra_kbc_of_match, &pdev->dev);
608605

609606
kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
610607
if (!kbc) {
@@ -613,7 +610,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
613610
}
614611

615612
kbc->dev = &pdev->dev;
616-
kbc->hw_support = match->data;
613+
kbc->hw_support = device_get_match_data(&pdev->dev);
617614
kbc->max_keys = kbc->hw_support->max_rows *
618615
kbc->hw_support->max_columns;
619616
kbc->num_rows_and_columns = kbc->hw_support->max_rows +

0 commit comments

Comments
 (0)