diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-09-09 16:03:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:51 -0400 |
commit | 08adb9e20be83bb4c5322bf15b966c537038f6d9 (patch) | |
tree | 65d97de16e4bf83c451405ef2bce2f64ffe5e06f /drivers/media/video | |
parent | 4c93b07a48039cee1d845f38294abec0f803e05e (diff) |
[PATCH] v4l: some error treatment implemented at resume functions.
- Some error treatment implemented at resume functions.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/bttv-driver.c | 18 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-mpeg.c | 20 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 20 |
3 files changed, 51 insertions, 7 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 */ |
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index 6d0d15c3a1c6..ee2300e1ae0b 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c | |||
@@ -455,14 +455,28 @@ int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state) | |||
455 | 455 | ||
456 | int cx8802_resume_common(struct pci_dev *pci_dev) | 456 | int cx8802_resume_common(struct pci_dev *pci_dev) |
457 | { | 457 | { |
458 | struct cx8802_dev *dev = pci_get_drvdata(pci_dev); | 458 | struct cx8802_dev *dev = pci_get_drvdata(pci_dev); |
459 | struct cx88_core *core = dev->core; | 459 | struct cx88_core *core = dev->core; |
460 | int err; | ||
460 | 461 | ||
461 | if (dev->state.disabled) { | 462 | if (dev->state.disabled) { |
462 | pci_enable_device(pci_dev); | 463 | err=pci_enable_device(pci_dev); |
464 | if (err) { | ||
465 | printk(KERN_ERR "%s: can't enable device\n", | ||
466 | dev->core->name); | ||
467 | return err; | ||
468 | } | ||
463 | dev->state.disabled = 0; | 469 | dev->state.disabled = 0; |
464 | } | 470 | } |
465 | pci_set_power_state(pci_dev, PCI_D0); | 471 | err=pci_set_power_state(pci_dev, PCI_D0); |
472 | if (err) { | ||
473 | printk(KERN_ERR "%s: can't enable device\n", | ||
474 | dev->core->name); | ||
475 | pci_disable_device(pci_dev); | ||
476 | dev->state.disabled = 1; | ||
477 | |||
478 | return err; | ||
479 | } | ||
466 | pci_restore_state(pci_dev); | 480 | pci_restore_state(pci_dev); |
467 | 481 | ||
468 | /* FIXME: re-initialize hardware */ | 482 | /* FIXME: re-initialize hardware */ |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 61d4b29ec302..3dbc074fb515 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -2005,12 +2005,28 @@ static int cx8800_resume(struct pci_dev *pci_dev) | |||
2005 | { | 2005 | { |
2006 | struct cx8800_dev *dev = pci_get_drvdata(pci_dev); | 2006 | struct cx8800_dev *dev = pci_get_drvdata(pci_dev); |
2007 | struct cx88_core *core = dev->core; | 2007 | struct cx88_core *core = dev->core; |
2008 | int err; | ||
2008 | 2009 | ||
2009 | if (dev->state.disabled) { | 2010 | if (dev->state.disabled) { |
2010 | pci_enable_device(pci_dev); | 2011 | err=pci_enable_device(pci_dev); |
2012 | if (err) { | ||
2013 | printk(KERN_ERR "%s: can't enable device\n", | ||
2014 | core->name); | ||
2015 | return err; | ||
2016 | } | ||
2017 | |||
2011 | dev->state.disabled = 0; | 2018 | dev->state.disabled = 0; |
2012 | } | 2019 | } |
2013 | pci_set_power_state(pci_dev, PCI_D0); | 2020 | err= pci_set_power_state(pci_dev, PCI_D0); |
2021 | if (err) { | ||
2022 | printk(KERN_ERR "%s: can't enable device\n", | ||
2023 | core->name); | ||
2024 | |||
2025 | pci_disable_device(pci_dev); | ||
2026 | dev->state.disabled = 1; | ||
2027 | |||
2028 | return err; | ||
2029 | } | ||
2014 | pci_restore_state(pci_dev); | 2030 | pci_restore_state(pci_dev); |
2015 | 2031 | ||
2016 | /* FIXME: re-initialize hardware */ | 2032 | /* FIXME: re-initialize hardware */ |