Skip to content

Commit e0c51fd

Browse files
geertuvinodkoul
authored andcommitted
dmaengine: sh: rz-dmac: Make channel irq local
The channel IRQ is only used inside the function rz_dmac_chan_probe(), so there is no need to store it in the rz_dmac_chan structure for later use. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/312c2e3349f4747e0bca861632bfc3592224b012.1767718556.git.geert+renesas@glider.be Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 8049f77 commit e0c51fd

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

drivers/dma/sh/rz-dmac.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ struct rz_dmac_chan {
6565
void __iomem *ch_base;
6666
void __iomem *ch_cmn_base;
6767
unsigned int index;
68-
int irq;
6968
struct rz_dmac_desc *desc;
7069
int descs_allocated;
7170

@@ -795,29 +794,27 @@ static int rz_dmac_chan_probe(struct rz_dmac *dmac,
795794
struct rz_lmdesc *lmdesc;
796795
char pdev_irqname[6];
797796
char *irqname;
798-
int ret;
797+
int irq, ret;
799798

800799
channel->index = index;
801800
channel->mid_rid = -EINVAL;
802801

803802
/* Request the channel interrupt. */
804803
scnprintf(pdev_irqname, sizeof(pdev_irqname), "ch%u", index);
805-
channel->irq = platform_get_irq_byname(pdev, pdev_irqname);
806-
if (channel->irq < 0)
807-
return channel->irq;
804+
irq = platform_get_irq_byname(pdev, pdev_irqname);
805+
if (irq < 0)
806+
return irq;
808807

809808
irqname = devm_kasprintf(dmac->dev, GFP_KERNEL, "%s:%u",
810809
dev_name(dmac->dev), index);
811810
if (!irqname)
812811
return -ENOMEM;
813812

814-
ret = devm_request_threaded_irq(dmac->dev, channel->irq,
815-
rz_dmac_irq_handler,
813+
ret = devm_request_threaded_irq(dmac->dev, irq, rz_dmac_irq_handler,
816814
rz_dmac_irq_handler_thread, 0,
817815
irqname, channel);
818816
if (ret) {
819-
dev_err(dmac->dev, "failed to request IRQ %u (%d)\n",
820-
channel->irq, ret);
817+
dev_err(dmac->dev, "failed to request IRQ %u (%d)\n", irq, ret);
821818
return ret;
822819
}
823820

0 commit comments

Comments
 (0)