mirror of
https://github.com/torvalds/linux.git
synced 2024-09-28 19:03:08 +00:00
serial: 8250_bcm7271: Propagate error codes from brcmuart_probe()
In case of failures brcmuart_probe() always returned -ENODEV, this
isn't correct for example platform_get_irq_byname() may return
-EPROBE_DEFER to handle such cases propagate error codes in
brcmuart_probe() in case of failures.
Fixes: 41a469482d
("serial: 8250: Add new 8250-core based Broadcom STB driver")
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20211224142917.6966-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
56c8b1c10e
commit
c195438f1e
|
@ -1074,14 +1074,18 @@ static int brcmuart_probe(struct platform_device *pdev)
|
||||||
priv->rx_bufs = dma_alloc_coherent(dev,
|
priv->rx_bufs = dma_alloc_coherent(dev,
|
||||||
priv->rx_size,
|
priv->rx_size,
|
||||||
&priv->rx_addr, GFP_KERNEL);
|
&priv->rx_addr, GFP_KERNEL);
|
||||||
if (!priv->rx_bufs)
|
if (!priv->rx_bufs) {
|
||||||
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
priv->tx_size = UART_XMIT_SIZE;
|
priv->tx_size = UART_XMIT_SIZE;
|
||||||
priv->tx_buf = dma_alloc_coherent(dev,
|
priv->tx_buf = dma_alloc_coherent(dev,
|
||||||
priv->tx_size,
|
priv->tx_size,
|
||||||
&priv->tx_addr, GFP_KERNEL);
|
&priv->tx_addr, GFP_KERNEL);
|
||||||
if (!priv->tx_buf)
|
if (!priv->tx_buf) {
|
||||||
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = serial8250_register_8250_port(&up);
|
ret = serial8250_register_8250_port(&up);
|
||||||
|
@ -1095,6 +1099,7 @@ static int brcmuart_probe(struct platform_device *pdev)
|
||||||
if (priv->dma_enabled) {
|
if (priv->dma_enabled) {
|
||||||
dma_irq = platform_get_irq_byname(pdev, "dma");
|
dma_irq = platform_get_irq_byname(pdev, "dma");
|
||||||
if (dma_irq < 0) {
|
if (dma_irq < 0) {
|
||||||
|
ret = dma_irq;
|
||||||
dev_err(dev, "no IRQ resource info\n");
|
dev_err(dev, "no IRQ resource info\n");
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
@ -1114,7 +1119,7 @@ err1:
|
||||||
err:
|
err:
|
||||||
brcmuart_free_bufs(dev, priv);
|
brcmuart_free_bufs(dev, priv);
|
||||||
brcmuart_arbitration(priv, 0);
|
brcmuart_arbitration(priv, 0);
|
||||||
return -ENODEV;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int brcmuart_remove(struct platform_device *pdev)
|
static int brcmuart_remove(struct platform_device *pdev)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user