diff options
author | Minghao Chi <chi.minghao@zte.com.cn> | 2022-03-15 02:31:38 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-20 09:06:38 +0200 |
commit | 9456478d90b056dbdf63622d9f6d198144522b47 (patch) | |
tree | fe1f699ff9973ef743f324cdbd037a8627e48bb5 /drivers/spi | |
parent | 3ec80d52b9b74b9e691997632a543c73eddfeba0 (diff) | |
download | linux-stable-9456478d90b056dbdf63622d9f6d198144522b47.tar.gz linux-stable-9456478d90b056dbdf63622d9f6d198144522b47.tar.bz2 linux-stable-9456478d90b056dbdf63622d9f6d198144522b47.zip |
spi: tegra20: Use of_device_get_match_data()
[ Upstream commit c9839acfcbe20ce43d363c2a9d0772472d9921c0 ]
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220315023138.2118293-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-tegra20-slink.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index 88bfe7682a9e..b8a3a78730b5 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -1016,14 +1016,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) { |