Skip to content

Commit 74955cb

Browse files
damien-lemoalLorenzo Pieralisi
authored andcommitted
PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
linux/pci.h defines the IRQ flags PCI_IRQ_INTX, PCI_IRQ_MSI and PCI_IRQ_MSIX. Let's use these flags directly instead of the endpoint definitions provided by enum pci_epc_irq_type. This removes the need for defining this enum type completely. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Serge Semin <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Acked-by: Manivannan Sadhasivam <[email protected]>
1 parent 58ff9c5 commit 74955cb

22 files changed

+65
-85
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,25 +532,24 @@ static int cdns_pcie_ep_send_msix_irq(struct cdns_pcie_ep *ep, u8 fn, u8 vfn,
532532
}
533533

534534
static int cdns_pcie_ep_raise_irq(struct pci_epc *epc, u8 fn, u8 vfn,
535-
enum pci_epc_irq_type type,
536-
u16 interrupt_num)
535+
unsigned int type, u16 interrupt_num)
537536
{
538537
struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
539538
struct cdns_pcie *pcie = &ep->pcie;
540539
struct device *dev = pcie->dev;
541540

542541
switch (type) {
543-
case PCI_EPC_IRQ_LEGACY:
542+
case PCI_IRQ_INTX:
544543
if (vfn > 0) {
545544
dev_err(dev, "Cannot raise legacy interrupts for VF\n");
546545
return -EINVAL;
547546
}
548547
return cdns_pcie_ep_send_legacy_irq(ep, fn, vfn, 0);
549548

550-
case PCI_EPC_IRQ_MSI:
549+
case PCI_IRQ_MSI:
551550
return cdns_pcie_ep_send_msi_irq(ep, fn, vfn, interrupt_num);
552551

553-
case PCI_EPC_IRQ_MSIX:
552+
case PCI_IRQ_MSIX:
554553
return cdns_pcie_ep_send_msix_irq(ep, fn, vfn, interrupt_num);
555554

556555
default:

drivers/pci/controller/dwc/pci-dra7xx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,16 +404,16 @@ static void dra7xx_pcie_raise_msi_irq(struct dra7xx_pcie *dra7xx,
404404
}
405405

406406
static int dra7xx_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
407-
enum pci_epc_irq_type type, u16 interrupt_num)
407+
unsigned int type, u16 interrupt_num)
408408
{
409409
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
410410
struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pci);
411411

412412
switch (type) {
413-
case PCI_EPC_IRQ_LEGACY:
413+
case PCI_IRQ_INTX:
414414
dra7xx_pcie_raise_legacy_irq(dra7xx);
415415
break;
416-
case PCI_EPC_IRQ_MSI:
416+
case PCI_IRQ_MSI:
417417
dra7xx_pcie_raise_msi_irq(dra7xx, interrupt_num);
418418
break;
419419
default:

drivers/pci/controller/dwc/pci-imx6.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,17 +1058,16 @@ static void imx6_pcie_ep_init(struct dw_pcie_ep *ep)
10581058
}
10591059

10601060
static int imx6_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
1061-
enum pci_epc_irq_type type,
1062-
u16 interrupt_num)
1061+
unsigned int type, u16 interrupt_num)
10631062
{
10641063
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
10651064

10661065
switch (type) {
1067-
case PCI_EPC_IRQ_LEGACY:
1066+
case PCI_IRQ_INTX:
10681067
return dw_pcie_ep_raise_legacy_irq(ep, func_no);
1069-
case PCI_EPC_IRQ_MSI:
1068+
case PCI_IRQ_MSI:
10701069
return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
1071-
case PCI_EPC_IRQ_MSIX:
1070+
case PCI_IRQ_MSIX:
10721071
return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
10731072
default:
10741073
dev_err(pci->dev, "UNKNOWN IRQ type\n");

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -900,20 +900,19 @@ static void ks_pcie_am654_raise_legacy_irq(struct keystone_pcie *ks_pcie)
900900
}
901901

902902
static int ks_pcie_am654_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
903-
enum pci_epc_irq_type type,
904-
u16 interrupt_num)
903+
unsigned int type, u16 interrupt_num)
905904
{
906905
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
907906
struct keystone_pcie *ks_pcie = to_keystone_pcie(pci);
908907

909908
switch (type) {
910-
case PCI_EPC_IRQ_LEGACY:
909+
case PCI_IRQ_INTX:
911910
ks_pcie_am654_raise_legacy_irq(ks_pcie);
912911
break;
913-
case PCI_EPC_IRQ_MSI:
912+
case PCI_IRQ_MSI:
914913
dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
915914
break;
916-
case PCI_EPC_IRQ_MSIX:
915+
case PCI_IRQ_MSIX:
917916
dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
918917
break;
919918
default:

drivers/pci/controller/dwc/pci-layerscape-ep.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,16 @@ static void ls_pcie_ep_init(struct dw_pcie_ep *ep)
166166
}
167167

168168
static int ls_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
169-
enum pci_epc_irq_type type, u16 interrupt_num)
169+
unsigned int type, u16 interrupt_num)
170170
{
171171
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
172172

173173
switch (type) {
174-
case PCI_EPC_IRQ_LEGACY:
174+
case PCI_IRQ_INTX:
175175
return dw_pcie_ep_raise_legacy_irq(ep, func_no);
176-
case PCI_EPC_IRQ_MSI:
176+
case PCI_IRQ_MSI:
177177
return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
178-
case PCI_EPC_IRQ_MSIX:
178+
case PCI_IRQ_MSIX:
179179
return dw_pcie_ep_raise_msix_irq_doorbell(ep, func_no,
180180
interrupt_num);
181181
default:

drivers/pci/controller/dwc/pcie-artpec6.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,15 +352,15 @@ static void artpec6_pcie_ep_init(struct dw_pcie_ep *ep)
352352
}
353353

354354
static int artpec6_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
355-
enum pci_epc_irq_type type, u16 interrupt_num)
355+
unsigned int type, u16 interrupt_num)
356356
{
357357
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
358358

359359
switch (type) {
360-
case PCI_EPC_IRQ_LEGACY:
361-
dev_err(pci->dev, "EP cannot trigger legacy IRQs\n");
360+
case PCI_IRQ_INTX:
361+
dev_err(pci->dev, "EP cannot trigger INTx IRQs\n");
362362
return -EINVAL;
363-
case PCI_EPC_IRQ_MSI:
363+
case PCI_IRQ_MSI:
364364
return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
365365
default:
366366
dev_err(pci->dev, "UNKNOWN IRQ type\n");

drivers/pci/controller/dwc/pcie-designware-ep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static int dw_pcie_ep_set_msix(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
443443
}
444444

445445
static int dw_pcie_ep_raise_irq(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
446-
enum pci_epc_irq_type type, u16 interrupt_num)
446+
unsigned int type, u16 interrupt_num)
447447
{
448448
struct dw_pcie_ep *ep = epc_get_drvdata(epc);
449449

drivers/pci/controller/dwc/pcie-designware-plat.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,16 @@ static void dw_plat_pcie_ep_init(struct dw_pcie_ep *ep)
4242
}
4343

4444
static int dw_plat_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
45-
enum pci_epc_irq_type type,
46-
u16 interrupt_num)
45+
unsigned int type, u16 interrupt_num)
4746
{
4847
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
4948

5049
switch (type) {
51-
case PCI_EPC_IRQ_LEGACY:
50+
case PCI_IRQ_INTX:
5251
return dw_pcie_ep_raise_legacy_irq(ep, func_no);
53-
case PCI_EPC_IRQ_MSI:
52+
case PCI_IRQ_MSI:
5453
return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
55-
case PCI_EPC_IRQ_MSIX:
54+
case PCI_IRQ_MSIX:
5655
return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
5756
default:
5857
dev_err(pci->dev, "UNKNOWN IRQ type\n");

drivers/pci/controller/dwc/pcie-designware.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ struct dw_pcie_ep_ops {
335335
void (*ep_init)(struct dw_pcie_ep *ep);
336336
void (*deinit)(struct dw_pcie_ep *ep);
337337
int (*raise_irq)(struct dw_pcie_ep *ep, u8 func_no,
338-
enum pci_epc_irq_type type, u16 interrupt_num);
338+
unsigned int type, u16 interrupt_num);
339339
const struct pci_epc_features* (*get_features)(struct dw_pcie_ep *ep);
340340
/*
341341
* Provide a method to implement the different func config space

drivers/pci/controller/dwc/pcie-keembay.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,19 +289,18 @@ static void keembay_pcie_ep_init(struct dw_pcie_ep *ep)
289289
}
290290

291291
static int keembay_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
292-
enum pci_epc_irq_type type,
293-
u16 interrupt_num)
292+
unsigned int type, u16 interrupt_num)
294293
{
295294
struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
296295

297296
switch (type) {
298-
case PCI_EPC_IRQ_LEGACY:
299-
/* Legacy interrupts are not supported in Keem Bay */
300-
dev_err(pci->dev, "Legacy IRQ is not supported\n");
297+
case PCI_IRQ_INTX:
298+
/* INTx interrupts are not supported in Keem Bay */
299+
dev_err(pci->dev, "INTx IRQ is not supported\n");
301300
return -EINVAL;
302-
case PCI_EPC_IRQ_MSI:
301+
case PCI_IRQ_MSI:
303302
return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
304-
case PCI_EPC_IRQ_MSIX:
303+
case PCI_IRQ_MSIX:
305304
return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
306305
default:
307306
dev_err(pci->dev, "Unknown IRQ type %d\n", type);

0 commit comments

Comments
 (0)