]> Git Repo - J-linux.git/commitdiff
spi: tegra20: Use of_device_get_match_data()
authorMinghao Chi <[email protected]>
Tue, 15 Mar 2022 02:31:38 +0000 (02:31 +0000)
committerMark Brown <[email protected]>
Wed, 16 Mar 2022 16:39:36 +0000 (16:39 +0000)
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]>
drivers/spi/spi-tegra20-slink.c

index 2a03739a0c609d96d344538a9fd066454a2bdd32..80c3787deea9de60bcd3be5d6aa3369313aa9511 100644 (file)
@@ -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) {
This page took 0.054254 seconds and 4 git commands to generate.