Commit 5faea3d0 authored by Thierry Reding's avatar Thierry Reding

drm/tegra: sor: Use of_device_get_match_data()

Avoid some boilerplate by calling of_device_get_match_data() instead of
open-coding the equivalent in the driver.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 5e4acd30
...@@ -2536,20 +2536,17 @@ MODULE_DEVICE_TABLE(of, tegra_sor_of_match); ...@@ -2536,20 +2536,17 @@ MODULE_DEVICE_TABLE(of, tegra_sor_of_match);
static int tegra_sor_probe(struct platform_device *pdev) static int tegra_sor_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match;
struct device_node *np; struct device_node *np;
struct tegra_sor *sor; struct tegra_sor *sor;
struct resource *regs; struct resource *regs;
int err; int err;
match = of_match_device(tegra_sor_of_match, &pdev->dev);
sor = devm_kzalloc(&pdev->dev, sizeof(*sor), GFP_KERNEL); sor = devm_kzalloc(&pdev->dev, sizeof(*sor), GFP_KERNEL);
if (!sor) if (!sor)
return -ENOMEM; return -ENOMEM;
sor->soc = of_device_get_match_data(&pdev->dev);
sor->output.dev = sor->dev = &pdev->dev; sor->output.dev = sor->dev = &pdev->dev;
sor->soc = match->data;
sor->settings = devm_kmemdup(&pdev->dev, sor->soc->settings, sor->settings = devm_kmemdup(&pdev->dev, sor->soc->settings,
sor->soc->num_settings * sor->soc->num_settings *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment