Skip to content

Commit 30963b2

Browse files
chleroygregkh
authored andcommitted
serial: cpm_uart: Don't request IRQ too early for console port
The following message is seen during boot and the activation of console port gets delayed until normal serial ports activation. [ 0.001346] irq: no irq domain found for pic@930 ! The console port doesn't need irq, perform irq reservation later, during cpm_uart probe. While at it, don't use NO_IRQ but 0 which is the value returned by irq_of_parse_and_map() in case of error. By chance powerpc's NO_IRQ has value 0 but on some architectures it is -1. Fixes: 14d893f ("powerpc/8xx: Convert CPM1 interrupt controller to platform_device") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/8bed0f30c2e9ef16ae64fb1243a16d54a48eb8da.1664526717.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 12f3a5e commit 30963b2

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

drivers/tty/serial/cpm_uart/cpm_uart_core.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,12 +1203,6 @@ static int cpm_uart_init_port(struct device_node *np,
12031203
pinfo->port.fifosize = pinfo->tx_nrfifos * pinfo->tx_fifosize;
12041204
spin_lock_init(&pinfo->port.lock);
12051205

1206-
pinfo->port.irq = irq_of_parse_and_map(np, 0);
1207-
if (pinfo->port.irq == NO_IRQ) {
1208-
ret = -EINVAL;
1209-
goto out_pram;
1210-
}
1211-
12121206
for (i = 0; i < NUM_GPIOS; i++) {
12131207
struct gpio_desc *gpiod;
12141208

@@ -1218,7 +1212,7 @@ static int cpm_uart_init_port(struct device_node *np,
12181212

12191213
if (IS_ERR(gpiod)) {
12201214
ret = PTR_ERR(gpiod);
1221-
goto out_irq;
1215+
goto out_pram;
12221216
}
12231217

12241218
if (gpiod) {
@@ -1244,8 +1238,6 @@ static int cpm_uart_init_port(struct device_node *np,
12441238

12451239
return cpm_uart_request_port(&pinfo->port);
12461240

1247-
out_irq:
1248-
irq_dispose_mapping(pinfo->port.irq);
12491241
out_pram:
12501242
cpm_uart_unmap_pram(pinfo, pram);
12511243
out_mem:
@@ -1425,11 +1417,17 @@ static int cpm_uart_probe(struct platform_device *ofdev)
14251417
/* initialize the device pointer for the port */
14261418
pinfo->port.dev = &ofdev->dev;
14271419

1420+
pinfo->port.irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
1421+
if (!pinfo->port.irq)
1422+
return -EINVAL;
1423+
14281424
ret = cpm_uart_init_port(ofdev->dev.of_node, pinfo);
1429-
if (ret)
1430-
return ret;
1425+
if (!ret)
1426+
return uart_add_one_port(&cpm_reg, &pinfo->port);
14311427

1432-
return uart_add_one_port(&cpm_reg, &pinfo->port);
1428+
irq_dispose_mapping(pinfo->port.irq);
1429+
1430+
return ret;
14331431
}
14341432

14351433
static int cpm_uart_remove(struct platform_device *ofdev)

0 commit comments

Comments
 (0)