]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
[media] saa7164: bugfix, avoid oops when driver unloads without firmware
authorSteven Toth <stoth@kernellabs.com>
Sun, 5 Sep 2010 14:24:50 +0000 (11:24 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 09:55:20 +0000 (07:55 -0200)
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/saa7164/saa7164-core.c
drivers/media/video/saa7164/saa7164-fw.c
drivers/media/video/saa7164/saa7164.h

index 222fbda0cb78ae601b944541bb98a0c35a109adb..99819ac65cc9d5eea71458356356cc8e12c2e31b 100644 (file)
@@ -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 ],
index e48e2b4878fcc785c6518bed2143d388a17bc482..484533c32bb18da44490304bb1a98707ed84e6cc 100644 (file)
@@ -604,6 +604,7 @@ int saa7164_downloadfirmware(struct saa7164_dev *dev)
                }
        }
 
+       dev->firmwareloaded = 1;
        ret = 0;
 
 out:
index f16b3f961199902314d53a16f94902e049d3b65c..5ff79ab04405bc8937a7080f9fda6c4f53989c38 100644 (file)
@@ -452,6 +452,7 @@ struct saa7164_dev {
 
        /* firmware status */
        struct saa7164_fw_status        fw_status;
+       u32                             firmwareloaded;
 
        tmComResHWDescr_t               hwdesc;
        tmComResInterfaceDescr_t        intfdesc;