]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: cadence: Remove duplicate message code definitions
authorHans Zhang <18255117159@163.com>
Tue, 1 Apr 2025 14:50:23 +0000 (22:50 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 28 May 2025 21:55:27 +0000 (16:55 -0500)
The Cadence PCIe controller driver defines message codes in enum
cdns_pcie_msg_code duplicating the existing PCIE_MSG_CODE_* definitions in
drivers/pci/pci.h. The driver only uses ASSERT_INTA and DEASSERT_INTA codes
from this enum.

Remove the redundant Cadence-specific enum definitions and use the ones
available in drivers/pci/pci.h. This helps in avoiding code duplication,
maintaining consistency with the spec, and simplifying the code
maintenance.

Signed-off-by: Hans Zhang <18255117159@163.com>
[mani: commit message rewording]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250401145023.22948-1-18255117159@163.com
drivers/pci/controller/cadence/pcie-cadence-ep.c
drivers/pci/controller/cadence/pcie-cadence.h

index 599ec4b1223e9d586750f9b7f9a7cf16e03abf4f..12454142f3b3f5d3cd670d5fcd583e5fa5e5b7b6 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/sizes.h>
 
 #include "pcie-cadence.h"
+#include "../../pci.h"
 
 #define CDNS_PCIE_EP_MIN_APERTURE              128     /* 128 bytes */
 #define CDNS_PCIE_EP_IRQ_PCI_ADDR_NONE         0x1
@@ -337,10 +338,10 @@ static void cdns_pcie_ep_assert_intx(struct cdns_pcie_ep *ep, u8 fn, u8 intx,
 
        if (is_asserted) {
                ep->irq_pending |= BIT(intx);
-               msg_code = MSG_CODE_ASSERT_INTA + intx;
+               msg_code = PCIE_MSG_CODE_ASSERT_INTA + intx;
        } else {
                ep->irq_pending &= ~BIT(intx);
-               msg_code = MSG_CODE_DEASSERT_INTA + intx;
+               msg_code = PCIE_MSG_CODE_DEASSERT_INTA + intx;
        }
 
        spin_lock_irqsave(&ep->lock, flags);
index 39ee9945c903ec88a11e336007769879ef9fd704..3632d5c12c2a610ee25dc8c0069ea8bae6f28d11 100644 (file)
@@ -250,17 +250,6 @@ struct cdns_pcie_rp_ib_bar {
 
 struct cdns_pcie;
 
-enum cdns_pcie_msg_code {
-       MSG_CODE_ASSERT_INTA    = 0x20,
-       MSG_CODE_ASSERT_INTB    = 0x21,
-       MSG_CODE_ASSERT_INTC    = 0x22,
-       MSG_CODE_ASSERT_INTD    = 0x23,
-       MSG_CODE_DEASSERT_INTA  = 0x24,
-       MSG_CODE_DEASSERT_INTB  = 0x25,
-       MSG_CODE_DEASSERT_INTC  = 0x26,
-       MSG_CODE_DEASSERT_INTD  = 0x27,
-};
-
 enum cdns_pcie_msg_routing {
        /* Route to Root Complex */
        MSG_ROUTING_TO_RC,