mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
spi: tegra20: Use of_device_get_match_data()
[ Upstream commit c9839acfcb ]
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1c200c8bce
commit
3ad817f1bd
@@ -1006,14 +1006,8 @@ static int tegra_slink_probe(struct platform_device *pdev)
|
|||||||
struct resource *r;
|
struct resource *r;
|
||||||
int ret, spi_irq;
|
int ret, spi_irq;
|
||||||
const struct tegra_slink_chip_data *cdata = NULL;
|
const struct tegra_slink_chip_data *cdata = NULL;
|
||||||
const struct of_device_id *match;
|
|
||||||
|
|
||||||
match = of_match_device(tegra_slink_of_match, &pdev->dev);
|
cdata = of_device_get_match_data(&pdev->dev);
|
||||||
if (!match) {
|
|
||||||
dev_err(&pdev->dev, "Error: No device match found\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
cdata = match->data;
|
|
||||||
|
|
||||||
master = spi_alloc_master(&pdev->dev, sizeof(*tspi));
|
master = spi_alloc_master(&pdev->dev, sizeof(*tspi));
|
||||||
if (!master) {
|
if (!master) {
|
||||||
|
|||||||
Reference in New Issue
Block a user