summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-10-02 14:08:27 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-28 15:00:01 -0200
commitb2f91ae30edfa95500183179082f0568e3e9b38e (patch)
treedc31a44e76047892376f9504b89cd7f02caab1d2 /drivers/media/platform/coda
parent4de69319f013f8ebf6ec5b949497870353eb799a (diff)
downloadop-kernel-dev-b2f91ae30edfa95500183179082f0568e3e9b38e.zip
op-kernel-dev-b2f91ae30edfa95500183179082f0568e3e9b38e.tar.gz
[media] coda: identify platform device earlier
We'll use this information to decide whether to request the JPEG IRQ later. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/coda')
-rw-r--r--drivers/media/platform/coda/coda-common.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 48be973..fb83c56 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1896,6 +1896,15 @@ static int coda_probe(struct platform_device *pdev)
if (!dev)
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);
INIT_LIST_HEAD(&dev->instances);
@@ -1963,17 +1972,6 @@ static int coda_probe(struct platform_device *pdev)
mutex_init(&dev->dev_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);
if (!dev->debugfs_root)
dev_warn(&pdev->dev, "failed to create debugfs root\n");
OpenPOWER on IntegriCloud