[PATCH v2 4/4] x86/quirks: Use pci_power_eq() in apple_airport_reset()

From: Habil Eren Türker

Date: Thu Nov 19 2026 - 09:36:06 EST


Use pci_power_eq() to check the PCI power state in the
Apple Airport reset quirk.

Signed-off-by: Habil Eren Türker <habilerenturker@xxxxxxxxxxx>
---
arch/x86/kernel/early-quirks.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 7459a073c74d..82a3c7f72d33 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -644,13 +644,13 @@ static void __init apple_airport_reset(int bus, int slot, int func)
/* Card may have been put into PCI_D3hot by grub quirk */
pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL);

- if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != (__force u16)PCI_D0) {
- pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
+ if (!pci_power_eq(pmcsr, PCI_D0)) {
+ pci_power_t_set(&pmcsr, PCI_D0);
write_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL, pmcsr);
mdelay(10);

pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL);
- if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != (__force u16)PCI_D0) {
+ if (!pci_power_eq(pmcsr, PCI_D0)) {
pr_err("pci 0000:%02x:%02x.%d: Cannot power up Apple AirPort card\n",
bus, slot, func);
return;
--
2.47.3