Skip to content

Commit c9839ac

Browse files
Minghao Chibroonie
Minghao Chi
authored andcommitted
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]>
1 parent 62cb1cf commit c9839ac

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/spi/spi-tegra20-slink.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,14 +1006,8 @@ static int tegra_slink_probe(struct platform_device *pdev)
10061006
struct resource *r;
10071007
int ret, spi_irq;
10081008
const struct tegra_slink_chip_data *cdata = NULL;
1009-
const struct of_device_id *match;
10101009

1011-
match = of_match_device(tegra_slink_of_match, &pdev->dev);
1012-
if (!match) {
1013-
dev_err(&pdev->dev, "Error: No device match found\n");
1014-
return -ENODEV;
1015-
}
1016-
cdata = match->data;
1010+
cdata = of_device_get_match_data(&pdev->dev);
10171011

10181012
master = spi_alloc_master(&pdev->dev, sizeof(*tspi));
10191013
if (!master) {

0 commit comments

Comments
 (0)