Skip to content

Commit 16b2da8

Browse files
Hans Zhangbjorn-helgaas
authored andcommitted
PCI: cadence: Remove duplicate message code definitions
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 <[email protected]> [mani: commit message rewording] Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 8805f32 commit 16b2da8

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

drivers/pci/controller/cadence/pcie-cadence-ep.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/sizes.h>
1313

1414
#include "pcie-cadence.h"
15+
#include "../../pci.h"
1516

1617
#define CDNS_PCIE_EP_MIN_APERTURE 128 /* 128 bytes */
1718
#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,
337338

338339
if (is_asserted) {
339340
ep->irq_pending |= BIT(intx);
340-
msg_code = MSG_CODE_ASSERT_INTA + intx;
341+
msg_code = PCIE_MSG_CODE_ASSERT_INTA + intx;
341342
} else {
342343
ep->irq_pending &= ~BIT(intx);
343-
msg_code = MSG_CODE_DEASSERT_INTA + intx;
344+
msg_code = PCIE_MSG_CODE_DEASSERT_INTA + intx;
344345
}
345346

346347
spin_lock_irqsave(&ep->lock, flags);

drivers/pci/controller/cadence/pcie-cadence.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,6 @@ struct cdns_pcie_rp_ib_bar {
250250

251251
struct cdns_pcie;
252252

253-
enum cdns_pcie_msg_code {
254-
MSG_CODE_ASSERT_INTA = 0x20,
255-
MSG_CODE_ASSERT_INTB = 0x21,
256-
MSG_CODE_ASSERT_INTC = 0x22,
257-
MSG_CODE_ASSERT_INTD = 0x23,
258-
MSG_CODE_DEASSERT_INTA = 0x24,
259-
MSG_CODE_DEASSERT_INTB = 0x25,
260-
MSG_CODE_DEASSERT_INTC = 0x26,
261-
MSG_CODE_DEASSERT_INTD = 0x27,
262-
};
263-
264253
enum cdns_pcie_msg_routing {
265254
/* Route to Root Complex */
266255
MSG_ROUTING_TO_RC,

0 commit comments

Comments
 (0)