summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2010-09-05 11:24:50 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 07:55:20 -0200
commit22760ed39c2383e7711753e7582dac5d6d5f647c (patch)
treea57c709890bc4ba916642cc1ed20078145c5134f /drivers/media/video/saa7164
parenta1c592b766ee94aaf0e2549b8ba4d0298c328484 (diff)
[media] saa7164: bugfix, avoid oops when driver unloads without firmware
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164')
-rw-r--r--drivers/media/video/saa7164/saa7164-core.c3
-rw-r--r--drivers/media/video/saa7164/saa7164-fw.c1
-rw-r--r--drivers/media/video/saa7164/saa7164.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c
index 222fbda0cb7..99819ac65cc 100644
--- a/drivers/media/video/saa7164/saa7164-core.c
+++ b/drivers/media/video/saa7164/saa7164-core.c
@@ -1423,7 +1423,8 @@ static void __devexit saa7164_finidev(struct pci_dev *pci_dev)
kthread_stop(dev->kthread);
dev->kthread = NULL;
}
- saa7164_api_set_debug(dev, 0x00);
+ if (dev->firmwareloaded)
+ saa7164_api_set_debug(dev, 0x00);
}
saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
diff --git a/drivers/media/video/saa7164/saa7164-fw.c b/drivers/media/video/saa7164/saa7164-fw.c
index e48e2b4878f..484533c32bb 100644
--- a/drivers/media/video/saa7164/saa7164-fw.c
+++ b/drivers/media/video/saa7164/saa7164-fw.c
@@ -604,6 +604,7 @@ int saa7164_downloadfirmware(struct saa7164_dev *dev)
}
}
+ dev->firmwareloaded = 1;
ret = 0;
out:
diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h
index f16b3f96119..5ff79ab0440 100644
--- a/drivers/media/video/saa7164/saa7164.h
+++ b/drivers/media/video/saa7164/saa7164.h
@@ -452,6 +452,7 @@ struct saa7164_dev {
/* firmware status */
struct saa7164_fw_status fw_status;
+ u32 firmwareloaded;
tmComResHWDescr_t hwdesc;
tmComResInterfaceDescr_t intfdesc;