Skip to content

Commit 0853b7e

Browse files
bijudasmarckleinebudde
authored andcommitted
can: rcar_canfd: Enhance multi_channel_irqs handling
Currently multi_channel_irqs has only 2 channels. But RZ/G3E has six channels. Enhance multi_channel_irqs handling to support more than two channels. Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Vincent Mailhol <[email protected]> Signed-off-by: Biju Das <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent e5258b3 commit 0853b7e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/can/rcar/rcar_canfd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,16 +1857,19 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
18571857

18581858
if (info->multi_channel_irqs) {
18591859
char *irq_name;
1860+
char name[10];
18601861
int err_irq;
18611862
int tx_irq;
18621863

1863-
err_irq = platform_get_irq_byname(pdev, ch == 0 ? "ch0_err" : "ch1_err");
1864+
scnprintf(name, sizeof(name), "ch%u_err", ch);
1865+
err_irq = platform_get_irq_byname(pdev, name);
18641866
if (err_irq < 0) {
18651867
err = err_irq;
18661868
goto fail;
18671869
}
18681870

1869-
tx_irq = platform_get_irq_byname(pdev, ch == 0 ? "ch0_trx" : "ch1_trx");
1871+
scnprintf(name, sizeof(name), "ch%u_trx", ch);
1872+
tx_irq = platform_get_irq_byname(pdev, name);
18701873
if (tx_irq < 0) {
18711874
err = tx_irq;
18721875
goto fail;

0 commit comments

Comments
 (0)