[media] coda: initialize hardware on pm runtime resume only if firmware available
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 18 Jul 2014 10:22:36 +0000 (07:22 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 21 Aug 2014 20:25:18 +0000 (15:25 -0500)
If no firmware was found and the coda module is unloaded, coda_runtime_resume
will be called without an allocated code buffer. Do not call coda_hw_init in
this case.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/coda.c

index ec82dec..75bdac0 100644 (file)
@@ -3903,7 +3903,7 @@ static int coda_runtime_resume(struct device *dev)
        struct coda_dev *cdev = dev_get_drvdata(dev);
        int ret = 0;
 
-       if (dev->pm_domain) {
+       if (dev->pm_domain && cdev->codebuf.vaddr) {
                ret = coda_hw_init(cdev);
                if (ret)
                        v4l2_err(&cdev->v4l2_dev, "HW initialization failed\n");