Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 333f16ec authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Vinod Koul
Browse files

dmaengine: tegra: don't open code of_device_get_match_data()



Use of_device_get_match_data() for getting matched data
instead of implementing this locally.

Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 94c622b2
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -1317,15 +1317,13 @@ static int tegra_dma_probe(struct platform_device *pdev)
	struct tegra_dma *tdma;
	struct tegra_dma *tdma;
	int ret;
	int ret;
	int i;
	int i;
	const struct tegra_dma_chip_data *cdata = NULL;
	const struct tegra_dma_chip_data *cdata;
	const struct of_device_id *match;


	match = of_match_device(tegra_dma_of_match, &pdev->dev);
	cdata = of_device_get_match_data(&pdev->dev);
	if (!match) {
	if (!cdata) {
		dev_err(&pdev->dev, "Error: No device match found\n");
		dev_err(&pdev->dev, "Error: No device match data found\n");
		return -ENODEV;
		return -ENODEV;
	}
	}
	cdata = match->data;


	tdma = devm_kzalloc(&pdev->dev, sizeof(*tdma) + cdata->nr_channels *
	tdma = devm_kzalloc(&pdev->dev, sizeof(*tdma) + cdata->nr_channels *
			sizeof(struct tegra_dma_channel), GFP_KERNEL);
			sizeof(struct tegra_dma_channel), GFP_KERNEL);