diff mbox

[1/1] dma: tegra: don't open code of_device_get_match_data()

Message ID 1456838680-3220-1-git-send-email-ldewangan@nvidia.com
State Superseded, archived
Headers show

Commit Message

Laxman Dewangan March 1, 2016, 1:24 p.m. UTC
Use of_device_get_match_data() for getting matched data
instead of implementing this locally.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/dma/tegra20-apb-dma.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Thierry Reding March 1, 2016, 2:26 p.m. UTC | #1
On Tue, Mar 01, 2016 at 06:54:40PM +0530, Laxman Dewangan wrote:
> Use of_device_get_match_data() for getting matched data
> instead of implementing this locally.
> 
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> ---
>  drivers/dma/tegra20-apb-dma.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>
Vinod Koul March 3, 2016, 3:53 p.m. UTC | #2
On Tue, Mar 01, 2016 at 06:54:40PM +0530, Laxman Dewangan wrote:
> Use of_device_get_match_data() for getting matched data
> instead of implementing this locally.

I have applied this after fixing subsystem name. Please ensure you use the
right name
Laxman Dewangan March 4, 2016, 2:04 a.m. UTC | #3
On Thursday 03 March 2016 09:23 PM, Vinod Koul wrote:
> On Tue, Mar 01, 2016 at 06:54:40PM +0530, Laxman Dewangan wrote:
>> Use of_device_get_match_data() for getting matched data
>> instead of implementing this locally.
> I have applied this after fixing subsystem name. Please ensure you use the
> right name
>
>
Ooops, the directory name is "dma" and hence I used subsystem name as "dma".
File names are also containing dma only and so this mistake happened.
Will keep in mind in future patches.

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 935da81..ced588f 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1317,15 +1317,13 @@  static int tegra_dma_probe(struct platform_device *pdev)
 	struct tegra_dma *tdma;
 	int ret;
 	int i;
-	const struct tegra_dma_chip_data *cdata = NULL;
-	const struct of_device_id *match;
+	const struct tegra_dma_chip_data *cdata;
 
-	match = of_match_device(tegra_dma_of_match, &pdev->dev);
-	if (!match) {
-		dev_err(&pdev->dev, "Error: No device match found\n");
+	cdata = of_device_get_match_data(&pdev->dev);
+	if (!cdata) {
+		dev_err(&pdev->dev, "Error: No device match data found\n");
 		return -ENODEV;
 	}
-	cdata = match->data;
 
 	tdma = devm_kzalloc(&pdev->dev, sizeof(*tdma) + cdata->nr_channels *
 			sizeof(struct tegra_dma_channel), GFP_KERNEL);