drm/tegra: sor: Use of_device_get_match_data()
authorThierry Reding <treding@nvidia.com>
Mon, 21 Aug 2017 15:33:14 +0000 (17:33 +0200)
committerThierry Reding <treding@nvidia.com>
Fri, 20 Oct 2017 12:19:53 +0000 (14:19 +0200)
Avoid some boilerplate by calling of_device_get_match_data() instead of
open-coding the equivalent in the driver.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/sor.c

index 7ab1d1dc7cd7388491f71a17d0627db956d05fd3..4bcacd3f48613d416deea7a32cff7f58c97709b3 100644 (file)
@@ -2536,20 +2536,17 @@ MODULE_DEVICE_TABLE(of, tegra_sor_of_match);
 
 static int tegra_sor_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match;
        struct device_node *np;
        struct tegra_sor *sor;
        struct resource *regs;
        int err;
 
-       match = of_match_device(tegra_sor_of_match, &pdev->dev);
-
        sor = devm_kzalloc(&pdev->dev, sizeof(*sor), GFP_KERNEL);
        if (!sor)
                return -ENOMEM;
 
+       sor->soc = of_device_get_match_data(&pdev->dev);
        sor->output.dev = sor->dev = &pdev->dev;
-       sor->soc = match->data;
 
        sor->settings = devm_kmemdup(&pdev->dev, sor->soc->settings,
                                     sor->soc->num_settings *