diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-26 14:31:15 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-26 14:31:15 -0400 |
commit | 9d434813641abb5d619224e165f391bf352b202b (patch) | |
tree | 1a1f01279cba8ab1b947769a217fe084f6eb9f34 /drivers/ide/pci/sc1200.c | |
parent | d5271be6b5601b3749cccd8ee89941d5868b90bf (diff) |
drivers/ide/pci/sc1200.c: fix suspend/resume buglets and warnings
* We shouldn't bother with dev->current_state, the PCI API functions we
call manage this for us (and do a far better job at it too).
* Remove pci_set_power_state(dev, PCI_D0) call in resume, as
pci_enable_device() does the same thing.
* Check pci_enable_device() return value. If it failed, fail
the entire resume and avoid programming timings into the [potentially
dead/asleep] chip.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/sc1200.c')
-rw-r--r-- | drivers/ide/pci/sc1200.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c index d2c8b5524f28..0a7b3202066d 100644 --- a/drivers/ide/pci/sc1200.c +++ b/drivers/ide/pci/sc1200.c | |||
@@ -324,17 +324,18 @@ static int sc1200_suspend (struct pci_dev *dev, pm_message_t state) | |||
324 | 324 | ||
325 | pci_disable_device(dev); | 325 | pci_disable_device(dev); |
326 | pci_set_power_state(dev, pci_choose_state(dev, state)); | 326 | pci_set_power_state(dev, pci_choose_state(dev, state)); |
327 | dev->current_state = state.event; | ||
328 | return 0; | 327 | return 0; |
329 | } | 328 | } |
330 | 329 | ||
331 | static int sc1200_resume (struct pci_dev *dev) | 330 | static int sc1200_resume (struct pci_dev *dev) |
332 | { | 331 | { |
333 | ide_hwif_t *hwif = NULL; | 332 | ide_hwif_t *hwif = NULL; |
333 | int i; | ||
334 | |||
335 | i = pci_enable_device(dev); | ||
336 | if (i) | ||
337 | return i; | ||
334 | 338 | ||
335 | pci_set_power_state(dev, PCI_D0); // bring chip back from sleep state | ||
336 | dev->current_state = PM_EVENT_ON; | ||
337 | pci_enable_device(dev); | ||
338 | // | 339 | // |
339 | // loop over all interfaces that are part of this pci device: | 340 | // loop over all interfaces that are part of this pci device: |
340 | // | 341 | // |