mirror of
https://github.com/torvalds/linux.git
synced 2024-12-30 23:02:08 +00:00
drm/tegra: dc: 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: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
a176c67d71
commit
b9ff7aeaef
@ -10,6 +10,7 @@
|
|||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/iommu.h>
|
#include <linux/iommu.h>
|
||||||
|
#include <linux/of_device.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/reset.h>
|
#include <linux/reset.h>
|
||||||
|
|
||||||
@ -1985,7 +1986,6 @@ static int tegra_dc_parse_dt(struct tegra_dc *dc)
|
|||||||
|
|
||||||
static int tegra_dc_probe(struct platform_device *pdev)
|
static int tegra_dc_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
const struct of_device_id *id;
|
|
||||||
struct resource *regs;
|
struct resource *regs;
|
||||||
struct tegra_dc *dc;
|
struct tegra_dc *dc;
|
||||||
int err;
|
int err;
|
||||||
@ -1994,14 +1994,11 @@ static int tegra_dc_probe(struct platform_device *pdev)
|
|||||||
if (!dc)
|
if (!dc)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
id = of_match_node(tegra_dc_of_match, pdev->dev.of_node);
|
dc->soc = of_device_get_match_data(&pdev->dev);
|
||||||
if (!id)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
spin_lock_init(&dc->lock);
|
spin_lock_init(&dc->lock);
|
||||||
INIT_LIST_HEAD(&dc->list);
|
INIT_LIST_HEAD(&dc->list);
|
||||||
dc->dev = &pdev->dev;
|
dc->dev = &pdev->dev;
|
||||||
dc->soc = id->data;
|
|
||||||
|
|
||||||
err = tegra_dc_parse_dt(dc);
|
err = tegra_dc_parse_dt(dc);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user