Commit b2f91ae3 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

[media] coda: identify platform device earlier

We'll use this information to decide whether to request the JPEG IRQ later.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 4de69319
...@@ -1896,6 +1896,15 @@ static int coda_probe(struct platform_device *pdev) ...@@ -1896,6 +1896,15 @@ static int coda_probe(struct platform_device *pdev)
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
pdev_id = of_id ? of_id->data : platform_get_device_id(pdev);
if (of_id)
dev->devtype = of_id->data;
else if (pdev_id)
dev->devtype = &coda_devdata[pdev_id->driver_data];
else
return -EINVAL;
spin_lock_init(&dev->irqlock); spin_lock_init(&dev->irqlock);
INIT_LIST_HEAD(&dev->instances); INIT_LIST_HEAD(&dev->instances);
...@@ -1963,17 +1972,6 @@ static int coda_probe(struct platform_device *pdev) ...@@ -1963,17 +1972,6 @@ static int coda_probe(struct platform_device *pdev)
mutex_init(&dev->dev_mutex); mutex_init(&dev->dev_mutex);
mutex_init(&dev->coda_mutex); mutex_init(&dev->coda_mutex);
pdev_id = of_id ? of_id->data : platform_get_device_id(pdev);
if (of_id) {
dev->devtype = of_id->data;
} else if (pdev_id) {
dev->devtype = &coda_devdata[pdev_id->driver_data];
} else {
v4l2_device_unregister(&dev->v4l2_dev);
return -EINVAL;
}
dev->debugfs_root = debugfs_create_dir("coda", NULL); dev->debugfs_root = debugfs_create_dir("coda", NULL);
if (!dev->debugfs_root) if (!dev->debugfs_root)
dev_warn(&pdev->dev, "failed to create debugfs root\n"); dev_warn(&pdev->dev, "failed to create debugfs root\n");
......
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