Commit 89e0032e authored by Thomas Gleixner's avatar Thomas Gleixner

soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq()

Just use the core function msi_get_virq().
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarNishanth Menon <nm@ti.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Acked-by: default avatarNishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20211210221815.269468319@linutronix.de
parent d86a6d47
...@@ -168,8 +168,7 @@ int xudma_pktdma_tflow_get_irq(struct udma_dev *ud, int udma_tflow_id) ...@@ -168,8 +168,7 @@ int xudma_pktdma_tflow_get_irq(struct udma_dev *ud, int udma_tflow_id)
{ {
const struct udma_oes_offsets *oes = &ud->soc_data->oes; const struct udma_oes_offsets *oes = &ud->soc_data->oes;
return ti_sci_inta_msi_get_virq(ud->dev, udma_tflow_id + return msi_get_virq(ud->dev, udma_tflow_id + oes->pktdma_tchan_flow);
oes->pktdma_tchan_flow);
} }
EXPORT_SYMBOL(xudma_pktdma_tflow_get_irq); EXPORT_SYMBOL(xudma_pktdma_tflow_get_irq);
...@@ -177,7 +176,6 @@ int xudma_pktdma_rflow_get_irq(struct udma_dev *ud, int udma_rflow_id) ...@@ -177,7 +176,6 @@ int xudma_pktdma_rflow_get_irq(struct udma_dev *ud, int udma_rflow_id)
{ {
const struct udma_oes_offsets *oes = &ud->soc_data->oes; const struct udma_oes_offsets *oes = &ud->soc_data->oes;
return ti_sci_inta_msi_get_virq(ud->dev, udma_rflow_id + return msi_get_virq(ud->dev, udma_rflow_id + oes->pktdma_rchan_flow);
oes->pktdma_rchan_flow);
} }
EXPORT_SYMBOL(xudma_pktdma_rflow_get_irq); EXPORT_SYMBOL(xudma_pktdma_rflow_get_irq);
...@@ -2313,8 +2313,7 @@ static int udma_alloc_chan_resources(struct dma_chan *chan) ...@@ -2313,8 +2313,7 @@ static int udma_alloc_chan_resources(struct dma_chan *chan)
/* Event from UDMA (TR events) only needed for slave TR mode channels */ /* Event from UDMA (TR events) only needed for slave TR mode channels */
if (is_slave_direction(uc->config.dir) && !uc->config.pkt_mode) { if (is_slave_direction(uc->config.dir) && !uc->config.pkt_mode) {
uc->irq_num_udma = ti_sci_inta_msi_get_virq(ud->dev, uc->irq_num_udma = msi_get_virq(ud->dev, irq_udma_idx);
irq_udma_idx);
if (uc->irq_num_udma <= 0) { if (uc->irq_num_udma <= 0) {
dev_err(ud->dev, "Failed to get udma irq (index: %u)\n", dev_err(ud->dev, "Failed to get udma irq (index: %u)\n",
irq_udma_idx); irq_udma_idx);
...@@ -2486,7 +2485,7 @@ static int bcdma_alloc_chan_resources(struct dma_chan *chan) ...@@ -2486,7 +2485,7 @@ static int bcdma_alloc_chan_resources(struct dma_chan *chan)
uc->psil_paired = true; uc->psil_paired = true;
} }
uc->irq_num_ring = ti_sci_inta_msi_get_virq(ud->dev, irq_ring_idx); uc->irq_num_ring = msi_get_virq(ud->dev, irq_ring_idx);
if (uc->irq_num_ring <= 0) { if (uc->irq_num_ring <= 0) {
dev_err(ud->dev, "Failed to get ring irq (index: %u)\n", dev_err(ud->dev, "Failed to get ring irq (index: %u)\n",
irq_ring_idx); irq_ring_idx);
...@@ -2503,8 +2502,7 @@ static int bcdma_alloc_chan_resources(struct dma_chan *chan) ...@@ -2503,8 +2502,7 @@ static int bcdma_alloc_chan_resources(struct dma_chan *chan)
/* Event from BCDMA (TR events) only needed for slave channels */ /* Event from BCDMA (TR events) only needed for slave channels */
if (is_slave_direction(uc->config.dir)) { if (is_slave_direction(uc->config.dir)) {
uc->irq_num_udma = ti_sci_inta_msi_get_virq(ud->dev, uc->irq_num_udma = msi_get_virq(ud->dev, irq_udma_idx);
irq_udma_idx);
if (uc->irq_num_udma <= 0) { if (uc->irq_num_udma <= 0) {
dev_err(ud->dev, "Failed to get bcdma irq (index: %u)\n", dev_err(ud->dev, "Failed to get bcdma irq (index: %u)\n",
irq_udma_idx); irq_udma_idx);
...@@ -2672,7 +2670,7 @@ static int pktdma_alloc_chan_resources(struct dma_chan *chan) ...@@ -2672,7 +2670,7 @@ static int pktdma_alloc_chan_resources(struct dma_chan *chan)
uc->psil_paired = true; uc->psil_paired = true;
uc->irq_num_ring = ti_sci_inta_msi_get_virq(ud->dev, irq_ring_idx); uc->irq_num_ring = msi_get_virq(ud->dev, irq_ring_idx);
if (uc->irq_num_ring <= 0) { if (uc->irq_num_ring <= 0) {
dev_err(ud->dev, "Failed to get ring irq (index: %u)\n", dev_err(ud->dev, "Failed to get ring irq (index: %u)\n",
irq_ring_idx); irq_ring_idx);
......
...@@ -647,7 +647,7 @@ int k3_ringacc_get_ring_irq_num(struct k3_ring *ring) ...@@ -647,7 +647,7 @@ int k3_ringacc_get_ring_irq_num(struct k3_ring *ring)
if (!ring) if (!ring)
return -EINVAL; return -EINVAL;
irq_num = ti_sci_inta_msi_get_virq(ring->parent->dev, ring->ring_id); irq_num = msi_get_virq(ring->parent->dev, ring->ring_id);
if (irq_num <= 0) if (irq_num <= 0)
irq_num = -EINVAL; irq_num = -EINVAL;
return irq_num; return irq_num;
......
...@@ -148,15 +148,3 @@ void ti_sci_inta_msi_domain_free_irqs(struct device *dev) ...@@ -148,15 +148,3 @@ void ti_sci_inta_msi_domain_free_irqs(struct device *dev)
ti_sci_inta_msi_free_descs(dev); ti_sci_inta_msi_free_descs(dev);
} }
EXPORT_SYMBOL_GPL(ti_sci_inta_msi_domain_free_irqs); EXPORT_SYMBOL_GPL(ti_sci_inta_msi_domain_free_irqs);
unsigned int ti_sci_inta_msi_get_virq(struct device *dev, u32 dev_index)
{
struct msi_desc *desc;
for_each_msi_entry(desc, dev)
if (desc->msi_index == dev_index)
return desc->irq;
return -ENODEV;
}
EXPORT_SYMBOL_GPL(ti_sci_inta_msi_get_virq);
...@@ -18,6 +18,5 @@ struct irq_domain ...@@ -18,6 +18,5 @@ struct irq_domain
struct irq_domain *parent); struct irq_domain *parent);
int ti_sci_inta_msi_domain_alloc_irqs(struct device *dev, int ti_sci_inta_msi_domain_alloc_irqs(struct device *dev,
struct ti_sci_resource *res); struct ti_sci_resource *res);
unsigned int ti_sci_inta_msi_get_virq(struct device *dev, u32 index);
void ti_sci_inta_msi_domain_free_irqs(struct device *dev); void ti_sci_inta_msi_domain_free_irqs(struct device *dev);
#endif /* __INCLUDE_LINUX_IRQCHIP_TI_SCI_INTA_H */ #endif /* __INCLUDE_LINUX_IRQCHIP_TI_SCI_INTA_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment