summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra/vic.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-08-21 19:03:27 +0300
committerThierry Reding <treding@nvidia.com>2017-10-20 15:19:54 +0300
commit829ce7a68f20054b9cda762fbbf662b33ca26756 (patch)
tree4236b167b7fec298582e824993e9bde90d0588d2 /drivers/gpu/drm/tegra/vic.c
parent5faea3d0f80f4fe481bcf994750b96c7429bebe1 (diff)
downloadlinux-829ce7a68f20054b9cda762fbbf662b33ca26756.tar.xz
drm/tegra: vic: 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>
Diffstat (limited to 'drivers/gpu/drm/tegra/vic.c')
-rw-r--r--drivers/gpu/drm/tegra/vic.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
index b66b8d898cb1..18024183aa2b 100644
--- a/drivers/gpu/drm/tegra/vic.c
+++ b/drivers/gpu/drm/tegra/vic.c
@@ -285,21 +285,18 @@ static const struct of_device_id vic_match[] = {
static int vic_probe(struct platform_device *pdev)
{
- struct vic_config *vic_config = NULL;
struct device *dev = &pdev->dev;
struct host1x_syncpt **syncpts;
struct resource *regs;
- const struct of_device_id *match;
struct vic *vic;
int err;
- match = of_match_device(vic_match, dev);
- vic_config = (struct vic_config *)match->data;
-
vic = devm_kzalloc(dev, sizeof(*vic), GFP_KERNEL);
if (!vic)
return -ENOMEM;
+ vic->config = of_device_get_match_data(dev);
+
syncpts = devm_kzalloc(dev, sizeof(*syncpts), GFP_KERNEL);
if (!syncpts)
return -ENOMEM;
@@ -328,7 +325,7 @@ static int vic_probe(struct platform_device *pdev)
if (err < 0)
return err;
- err = falcon_read_firmware(&vic->falcon, vic_config->firmware);
+ err = falcon_read_firmware(&vic->falcon, vic->config->firmware);
if (err < 0)
goto exit_falcon;
@@ -341,7 +338,6 @@ static int vic_probe(struct platform_device *pdev)
vic->client.base.syncpts = syncpts;
vic->client.base.num_syncpts = 1;
vic->dev = dev;
- vic->config = vic_config;
INIT_LIST_HEAD(&vic->client.list);
vic->client.ops = &vic_ops;