diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-10-29 13:58:25 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-12-07 15:32:53 -0500 |
commit | 5f8d17f6023ea9aca7c0063c5b472529f2664944 (patch) | |
tree | 0a6c84cc5f02f35dae5488fcf1ed9db3e6559e81 /drivers/ieee1394/ohci1394.c | |
parent | 2a3f8ad3a94c784f57958bd692428cb342ce4114 (diff) |
ieee1394: ohci1394: proper log messages in suspend and resume
- correct thinko in one of my last commits: cannot use PRINT macro with
ohci == NULL
- add log messages on ohci == NULL and on pci_enable_device != 0
- update log macros from patch "revert fail on error in suspend" to use
PRINT and DBGMSG where possible
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/ohci1394.c')
-rw-r--r-- | drivers/ieee1394/ohci1394.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index 44adefd71684..406b7501b9b7 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c | |||
@@ -3537,9 +3537,12 @@ static int ohci1394_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3537 | printk(KERN_INFO "%s does not fully support suspend and resume yet\n", | 3537 | printk(KERN_INFO "%s does not fully support suspend and resume yet\n", |
3538 | OHCI1394_DRIVER_NAME); | 3538 | OHCI1394_DRIVER_NAME); |
3539 | 3539 | ||
3540 | PRINT(KERN_DEBUG, "suspend called"); | 3540 | if (!ohci) { |
3541 | if (!ohci) | 3541 | printk(KERN_ERR "%s: tried to suspend nonexisting host\n", |
3542 | OHCI1394_DRIVER_NAME); | ||
3542 | return -ENXIO; | 3543 | return -ENXIO; |
3544 | } | ||
3545 | DBGMSG("suspend called"); | ||
3543 | 3546 | ||
3544 | /* Clear the async DMA contexts and stop using the controller */ | 3547 | /* Clear the async DMA contexts and stop using the controller */ |
3545 | hpsb_bus_reset(ohci->host); | 3548 | hpsb_bus_reset(ohci->host); |
@@ -3562,16 +3565,12 @@ static int ohci1394_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3562 | 3565 | ||
3563 | err = pci_save_state(pdev); | 3566 | err = pci_save_state(pdev); |
3564 | if (err) { | 3567 | if (err) { |
3565 | printk(KERN_ERR "%s: pci_save_state failed with %d\n", | 3568 | PRINT(KERN_ERR, "pci_save_state failed with %d", err); |
3566 | OHCI1394_DRIVER_NAME, err); | ||
3567 | return err; | 3569 | return err; |
3568 | } | 3570 | } |
3569 | err = pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 3571 | err = pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
3570 | #ifdef OHCI1394_DEBUG | ||
3571 | if (err) | 3572 | if (err) |
3572 | printk(KERN_DEBUG "%s: pci_set_power_state failed with %d\n", | 3573 | DBGMSG("pci_set_power_state failed with %d", err); |
3573 | OHCI1394_DRIVER_NAME, err); | ||
3574 | #endif /* OHCI1394_DEBUG */ | ||
3575 | 3574 | ||
3576 | /* PowerMac suspend code comes last */ | 3575 | /* PowerMac suspend code comes last */ |
3577 | #ifdef CONFIG_PPC_PMAC | 3576 | #ifdef CONFIG_PPC_PMAC |
@@ -3593,9 +3592,12 @@ static int ohci1394_pci_resume(struct pci_dev *pdev) | |||
3593 | int err; | 3592 | int err; |
3594 | struct ti_ohci *ohci = pci_get_drvdata(pdev); | 3593 | struct ti_ohci *ohci = pci_get_drvdata(pdev); |
3595 | 3594 | ||
3596 | PRINT(KERN_DEBUG, "resume called"); | 3595 | if (!ohci) { |
3597 | if (!ohci) | 3596 | printk(KERN_ERR "%s: tried to resume nonexisting host\n", |
3597 | OHCI1394_DRIVER_NAME); | ||
3598 | return -ENXIO; | 3598 | return -ENXIO; |
3599 | } | ||
3600 | DBGMSG("resume called"); | ||
3599 | 3601 | ||
3600 | /* PowerMac resume code comes first */ | 3602 | /* PowerMac resume code comes first */ |
3601 | #ifdef CONFIG_PPC_PMAC | 3603 | #ifdef CONFIG_PPC_PMAC |
@@ -3612,8 +3614,10 @@ static int ohci1394_pci_resume(struct pci_dev *pdev) | |||
3612 | pci_set_power_state(pdev, PCI_D0); | 3614 | pci_set_power_state(pdev, PCI_D0); |
3613 | pci_restore_state(pdev); | 3615 | pci_restore_state(pdev); |
3614 | err = pci_enable_device(pdev); | 3616 | err = pci_enable_device(pdev); |
3615 | if (err) | 3617 | if (err) { |
3618 | PRINT(KERN_ERR, "pci_enable_device failed with %d", err); | ||
3616 | return err; | 3619 | return err; |
3620 | } | ||
3617 | 3621 | ||
3618 | /* See ohci1394_pci_probe() for comments on this sequence */ | 3622 | /* See ohci1394_pci_probe() for comments on this sequence */ |
3619 | ohci_soft_reset(ohci); | 3623 | ohci_soft_reset(ohci); |