Skip to content

Commit 59cd046

Browse files
digetxjoergroedel
authored andcommitted
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>
1 parent b3bb6b8 commit 59cd046

File tree

1 file changed

+2
-6
lines changed
  • drivers/memory/tegra

1 file changed

+2
-6
lines changed

drivers/memory/tegra/mc.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/kernel.h>
1313
#include <linux/module.h>
1414
#include <linux/of.h>
15+
#include <linux/of_device.h>
1516
#include <linux/platform_device.h>
1617
#include <linux/slab.h>
1718
#include <linux/sort.h>
@@ -619,23 +620,18 @@ static __maybe_unused irqreturn_t tegra20_mc_irq(int irq, void *data)
619620

620621
static int tegra_mc_probe(struct platform_device *pdev)
621622
{
622-
const struct of_device_id *match;
623623
struct resource *res;
624624
struct tegra_mc *mc;
625625
void *isr;
626626
int err;
627627

628-
match = of_match_node(tegra_mc_of_match, pdev->dev.of_node);
629-
if (!match)
630-
return -ENODEV;
631-
632628
mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL);
633629
if (!mc)
634630
return -ENOMEM;
635631

636632
platform_set_drvdata(pdev, mc);
637633
spin_lock_init(&mc->lock);
638-
mc->soc = match->data;
634+
mc->soc = of_device_get_match_data(&pdev->dev);
639635
mc->dev = &pdev->dev;
640636

641637
/* length of MC tick in nanoseconds */

0 commit comments

Comments
 (0)