aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-12-12 15:38:54 -0500
committerJoerg Roedel <jroedel@suse.de>2019-01-16 07:54:12 -0500
commit59cd046f7f94543540d82216dbbfd8146db43b70 (patch)
tree178555c4b819efe46fd1e6d1539d31826a5d0d81 /drivers/memory
parentb3bb6b858f2a60fe3ac0c3833084386f7dd420e4 (diff)
memory: tegra: Use of_device_get_match_data()
There is no need to match device with the DT node since it was already matched, use of_device_get_match_data() helper to get the match-data. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/tegra/mc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index ce8cf81b55d7..55ecfb2d8cfd 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/of_device.h>
15#include <linux/platform_device.h> 16#include <linux/platform_device.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
17#include <linux/sort.h> 18#include <linux/sort.h>
@@ -619,23 +620,18 @@ static __maybe_unused irqreturn_t tegra20_mc_irq(int irq, void *data)
619 620
620static int tegra_mc_probe(struct platform_device *pdev) 621static int tegra_mc_probe(struct platform_device *pdev)
621{ 622{
622 const struct of_device_id *match;
623 struct resource *res; 623 struct resource *res;
624 struct tegra_mc *mc; 624 struct tegra_mc *mc;
625 void *isr; 625 void *isr;
626 int err; 626 int err;
627 627
628 match = of_match_node(tegra_mc_of_match, pdev->dev.of_node);
629 if (!match)
630 return -ENODEV;
631
632 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); 628 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL);
633 if (!mc) 629 if (!mc)
634 return -ENOMEM; 630 return -ENOMEM;
635 631
636 platform_set_drvdata(pdev, mc); 632 platform_set_drvdata(pdev, mc);
637 spin_lock_init(&mc->lock); 633 spin_lock_init(&mc->lock);
638 mc->soc = match->data; 634 mc->soc = of_device_get_match_data(&pdev->dev);
639 mc->dev = &pdev->dev; 635 mc->dev = &pdev->dev;
640 636
641 /* length of MC tick in nanoseconds */ 637 /* length of MC tick in nanoseconds */