aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinghao Chi <[email protected]>2022-03-15 02:31:38 +0000
committerMark Brown <[email protected]>2022-03-16 16:39:36 +0000
commitc9839acfcbe20ce43d363c2a9d0772472d9921c0 (patch)
treed915885ccd77854b06835e86f6635b7175b32004
parent62cb1cfed62bd50b638b016a6396624de2a43159 (diff)
spi: tegra20: Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Minghao Chi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/spi/spi-tegra20-slink.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 2a03739a0c60..80c3787deea9 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -1006,14 +1006,8 @@ static int tegra_slink_probe(struct platform_device *pdev)
struct resource *r;
int ret, spi_irq;
const struct tegra_slink_chip_data *cdata = NULL;
- const struct of_device_id *match;
- match = of_match_device(tegra_slink_of_match, &pdev->dev);
- if (!match) {
- dev_err(&pdev->dev, "Error: No device match found\n");
- return -ENODEV;
- }
- cdata = match->data;
+ cdata = of_device_get_match_data(&pdev->dev);
master = spi_alloc_master(&pdev->dev, sizeof(*tspi));
if (!master) {