summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bttv-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-08-30 15:01:48 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-08-30 15:01:48 +0000
commit8f30d6e37f1ea1d6e37a159e108c8d628a14f31a (patch)
treeeb774d33b4c2bd1846d458cbea05f627b59d6dd3 /linux/drivers/media/video/bttv-driver.c
parent94627c1ab5e9c28d6a4bbddaf3ac71fbdaeead9a (diff)
downloadmediapointer-dvb-s2-8f30d6e37f1ea1d6e37a159e108c8d628a14f31a.tar.gz
mediapointer-dvb-s2-8f30d6e37f1ea1d6e37a159e108c8d628a14f31a.tar.bz2
- Some error treatment implemented at resume functions.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/bttv-driver.c')
-rw-r--r--linux/drivers/media/video/bttv-driver.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/linux/drivers/media/video/bttv-driver.c b/linux/drivers/media/video/bttv-driver.c
index 8b60eff0c..15b34f95d 100644
--- a/linux/drivers/media/video/bttv-driver.c
+++ b/linux/drivers/media/video/bttv-driver.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-driver.c,v 1.54 2005/08/17 04:45:52 mkrufky Exp $
+ $Id: bttv-driver.c,v 1.55 2005/08/30 15:01:48 mchehab Exp $
bttv - Bt848 frame grabber driver
@@ -4154,15 +4154,29 @@ static int bttv_resume(struct pci_dev *pci_dev)
{
struct bttv *btv = pci_get_drvdata(pci_dev);
unsigned long flags;
+ int err;
dprintk("bttv%d: resume\n", btv->c.nr);
/* restore pci state */
if (btv->state.disabled) {
- pci_enable_device(pci_dev);
+ err=pci_enable_device(pci_dev);
+ if (err) {
+ printk(KERN_WARNING "bttv%d: Can't enable device.\n",
+ btv->c.nr);
+ return err;
+ }
btv->state.disabled = 0;
}
- pci_set_power_state(pci_dev, PCI_D0);
+ err=pci_set_power_state(pci_dev, PCI_D0);
+ if (err) {
+ pci_disable_device(pci_dev);
+ printk(KERN_WARNING "bttv%d: Can't enable device.\n",
+ btv->c.nr);
+ btv->state.disabled = 1;
+ return err;
+ }
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
pci_restore_state(pci_dev, btv->state.pci_cfg);
#else