From: Philipp Zabel
Date: Fri, 18 Jul 2014 10:22:36 +0000 (-0300)
Subject: [media] coda: initialize hardware on pm runtime resume only if firmware available
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=65919e6baa4e6e193dd7e4aa4cfd94b9d69e367e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git
[media] coda: initialize hardware on pm runtime resume only if firmware available
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
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index ec82dec04e31..75bdac0d3b07 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -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");