diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-08-30 15:01:48 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-08-30 15:01:48 +0000 |
commit | 8f30d6e37f1ea1d6e37a159e108c8d628a14f31a (patch) | |
tree | eb774d33b4c2bd1846d458cbea05f627b59d6dd3 /linux/drivers/media | |
parent | 94627c1ab5e9c28d6a4bbddaf3ac71fbdaeead9a (diff) | |
download | mediapointer-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')
-rw-r--r-- | linux/drivers/media/video/bttv-driver.c | 20 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-mpeg.c | 22 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 22 |
3 files changed, 54 insertions, 10 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 diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c index efd5fbe22..4c2daad11 100644 --- a/linux/drivers/media/video/cx88/cx88-mpeg.c +++ b/linux/drivers/media/video/cx88/cx88-mpeg.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-mpeg.c,v 1.37 2005/08/20 06:08:55 mkrufky Exp $ + * $Id: cx88-mpeg.c,v 1.38 2005/08/30 15:01:48 mchehab Exp $ * * Support for the mpeg transport stream transfers * PCI function #2 of the cx2388x. @@ -482,14 +482,28 @@ int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state) int cx8802_resume_common(struct pci_dev *pci_dev) { - struct cx8802_dev *dev = pci_get_drvdata(pci_dev); + struct cx8802_dev *dev = pci_get_drvdata(pci_dev); struct cx88_core *core = dev->core; + int err; if (dev->state.disabled) { - pci_enable_device(pci_dev); + err=pci_enable_device(pci_dev); + if (err) { + printk(KERN_ERR "%s: can't enable device\n", + dev->core->name); + return err; + } dev->state.disabled = 0; } - pci_set_power_state(pci_dev, PCI_D0); + err=pci_set_power_state(pci_dev, PCI_D0); + if (err) { + printk(KERN_ERR "%s: can't enable device\n", + dev->core->name); + pci_disable_device(pci_dev); + dev->state.disabled = 1; + + return err; + } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) pci_restore_state(pci_dev, dev->state.pci_cfg); #else diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 705485ea7..12a933084 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.89 2005/08/17 20:55:37 catalin Exp $ + * $Id: cx88-video.c,v 1.90 2005/08/30 15:01:48 mchehab Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -2307,12 +2307,28 @@ static int cx8800_resume(struct pci_dev *pci_dev) { struct cx8800_dev *dev = pci_get_drvdata(pci_dev); struct cx88_core *core = dev->core; + int err; if (dev->state.disabled) { - pci_enable_device(pci_dev); + err=pci_enable_device(pci_dev); + if (err) { + printk(KERN_ERR "%s: can't enable device\n", + core->name); + return err; + } + dev->state.disabled = 0; } - pci_set_power_state(pci_dev, PCI_D0); + err= pci_set_power_state(pci_dev, PCI_D0); + if (err) { + printk(KERN_ERR "%s: can't enable device\n", + core->name); + + pci_disable_device(pci_dev); + dev->state.disabled = 1; + + return err; + } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) pci_restore_state(pci_dev, dev->state.pci_cfg); #else |