Re: [PATCH v7 10/19] PCI: microchip: Add num_events field to struct plda_pcie_rp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 27, 2023 at 06:07:53PM +0800, Minda Chen wrote:
> Avoid using NUM_EVENTS macros in common codes.

This isn't common code though, this code is in the Microchip driver.
It may become common code later, but for now the commit message is
inaccurate. Otherwise, the change itself seems okay to me, so with an
accurate commit message
Reviewed-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>

Thanks,
Conor.

> 
> Signed-off-by: Minda Chen <minda.chen@xxxxxxxxxxxxxxxx>
> ---
>  drivers/pci/controller/plda/pcie-microchip-host.c | 7 ++++---
>  drivers/pci/controller/plda/pcie-plda.h           | 1 +
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c
> index 81aac2d72a2f..d9dd63084e2b 100644
> --- a/drivers/pci/controller/plda/pcie-microchip-host.c
> +++ b/drivers/pci/controller/plda/pcie-microchip-host.c
> @@ -648,7 +648,7 @@ static void plda_handle_event(struct irq_desc *desc)
>  
>  	events = mc_get_events(port);
>  
> -	for_each_set_bit(bit, &events, NUM_EVENTS)
> +	for_each_set_bit(bit, &events, port->num_events)
>  		generic_handle_domain_irq(port->event_domain, bit);
>  
>  	chained_irq_exit(chip, desc);
> @@ -811,7 +811,7 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port)
>  		return -EINVAL;
>  	}
>  
> -	port->event_domain = irq_domain_add_linear(pcie_intc_node, NUM_EVENTS,
> +	port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events,
>  						   &mc_event_domain_ops, port);
>  	if (!port->event_domain) {
>  		dev_err(dev, "failed to get event domain\n");
> @@ -914,7 +914,7 @@ static int plda_init_interrupts(struct platform_device *pdev, struct plda_pcie_r
>  	if (irq < 0)
>  		return -ENODEV;
>  
> -	for (i = 0; i < NUM_EVENTS; i++) {
> +	for (i = 0; i < port->num_events; i++) {
>  		event_irq = irq_create_mapping(port->event_domain, i);
>  		if (!event_irq) {
>  			dev_err(dev, "failed to map hwirq %d\n", i);
> @@ -1006,6 +1006,7 @@ static int mc_host_probe(struct platform_device *pdev)
>  
>  	bridge_base_addr = port->axi_base_addr + MC_PCIE_BRIDGE_ADDR;
>  	plda->bridge_addr = bridge_base_addr;
> +	plda->num_events = NUM_EVENTS;
>  
>  	/* Allow enabling MSI by disabling MSI-X */
>  	val = readl(bridge_base_addr + PCIE_PCI_IRQ_DW0);
> diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h
> index 32a913d4101f..5b09ffed623c 100644
> --- a/drivers/pci/controller/plda/pcie-plda.h
> +++ b/drivers/pci/controller/plda/pcie-plda.h
> @@ -150,6 +150,7 @@ struct plda_pcie_rp {
>  	raw_spinlock_t lock;
>  	struct plda_msi msi;
>  	void __iomem *bridge_addr;
> +	int num_events;
>  };
>  
>  irqreturn_t plda_event_handler(int irq, void *dev_id);
> -- 
> 2.17.1
> 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux