summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-12-14 13:06:40 -0700
committerBjorn Helgaas <bhelgaas@google.com>2013-12-15 18:00:00 -0700
commit2f2ed41cf43e22686349ecdf4ca247ea3831af55 (patch)
treec7fe79e01f0cc18f5a5dd878f0002d924abbb49b
parentafe2478f2e3fffc45a1be24ebfc23945a66a80fd (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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 55109d6d8a9..cb3100af7e8 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)
/* Clear sticky power-fault bit from previous power failures */
pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
- slot_status &= PCI_EXP_SLTSTA_PFD;
- if (slot_status)
- pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, slot_status);
+ if (slot_status & PCI_EXP_SLTSTA_PFD)
+ pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
+ PCI_EXP_SLTSTA_PFD);
ctrl->power_fault_detected = 0;
slot_cmd = POWER_ON;