diff options
| author | Bjorn Helgaas <bhelgaas@google.com> | 2013-12-14 15:06:40 -0500 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-12-15 20:00:00 -0500 |
| commit | 2f2ed41cf43e22686349ecdf4ca247ea3831af55 (patch) | |
| tree | c7fe79e01f0cc18f5a5dd878f0002d924abbb49b | |
| parent | afe2478f2e3fffc45a1be24ebfc23945a66a80fd (diff) | |
PCI: pciehp: Simplify "Power Fault Detected" checking/clearing
It's simpler to test the PCI_EXP_SLTSTA_PFD bit directly and to write the
constant back to PCI_EXP_SLTSTA.
No functional change.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
| -rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 55109d6d8a90..cb3100af7e8c 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
| @@ -501,9 +501,9 @@ int pciehp_power_on_slot(struct slot * slot) | |||
| 501 | 501 | ||
| 502 | /* Clear sticky power-fault bit from previous power failures */ | 502 | /* Clear sticky power-fault bit from previous power failures */ |
| 503 | pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); | 503 | pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); |
| 504 | slot_status &= PCI_EXP_SLTSTA_PFD; | 504 | if (slot_status & PCI_EXP_SLTSTA_PFD) |
| 505 | if (slot_status) | 505 | pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, |
| 506 | pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, slot_status); | 506 | PCI_EXP_SLTSTA_PFD); |
| 507 | ctrl->power_fault_detected = 0; | 507 | ctrl->power_fault_detected = 0; |
| 508 | 508 | ||
| 509 | slot_cmd = POWER_ON; | 509 | slot_cmd = POWER_ON; |
