diff options
Diffstat (limited to 'drivers/media/video/bttv-driver.c')
-rw-r--r-- | drivers/media/video/bttv-driver.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index 53ecdbf46222..b35c586a2250 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c | |||
@@ -4111,15 +4111,29 @@ static int bttv_resume(struct pci_dev *pci_dev) | |||
4111 | { | 4111 | { |
4112 | struct bttv *btv = pci_get_drvdata(pci_dev); | 4112 | struct bttv *btv = pci_get_drvdata(pci_dev); |
4113 | unsigned long flags; | 4113 | unsigned long flags; |
4114 | int err; | ||
4114 | 4115 | ||
4115 | dprintk("bttv%d: resume\n", btv->c.nr); | 4116 | dprintk("bttv%d: resume\n", btv->c.nr); |
4116 | 4117 | ||
4117 | /* restore pci state */ | 4118 | /* restore pci state */ |
4118 | if (btv->state.disabled) { | 4119 | if (btv->state.disabled) { |
4119 | pci_enable_device(pci_dev); | 4120 | err=pci_enable_device(pci_dev); |
4121 | if (err) { | ||
4122 | printk(KERN_WARNING "bttv%d: Can't enable device.\n", | ||
4123 | btv->c.nr); | ||
4124 | return err; | ||
4125 | } | ||
4120 | btv->state.disabled = 0; | 4126 | btv->state.disabled = 0; |
4121 | } | 4127 | } |
4122 | pci_set_power_state(pci_dev, PCI_D0); | 4128 | err=pci_set_power_state(pci_dev, PCI_D0); |
4129 | if (err) { | ||
4130 | pci_disable_device(pci_dev); | ||
4131 | printk(KERN_WARNING "bttv%d: Can't enable device.\n", | ||
4132 | btv->c.nr); | ||
4133 | btv->state.disabled = 1; | ||
4134 | return err; | ||
4135 | } | ||
4136 | |||
4123 | pci_restore_state(pci_dev); | 4137 | pci_restore_state(pci_dev); |
4124 | 4138 | ||
4125 | /* restore bt878 state */ | 4139 | /* restore bt878 state */ |