All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
To: linux-serial@vger.kernel.org, Al Cooper <alcooperx@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org,
	Prabhakar <prabhakar.csengg@gmail.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	bcm-kernel-feedback-list@broadcom.com
Subject: [PATCH 03/10] serial: 8250_bcm7271: Propagate error codes from brcmuart_probe()
Date: Fri, 24 Dec 2021 14:29:09 +0000	[thread overview]
Message-ID: <20211224142917.6966-4-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)
In-Reply-To: <20211224142917.6966-1-prabhakar.mahadev-lad.rj@bp.renesas.com>

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: 41a469482de25 ("serial: 8250: Add new 8250-core based Broadcom STB driver")
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/tty/serial/8250/8250_bcm7271.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
index 7ecfcc650d28..cc60a7874e8b 100644
--- a/drivers/tty/serial/8250/8250_bcm7271.c
+++ b/drivers/tty/serial/8250/8250_bcm7271.c
@@ -1074,14 +1074,18 @@ static int brcmuart_probe(struct platform_device *pdev)
 		priv->rx_bufs = dma_alloc_coherent(dev,
 						   priv->rx_size,
 						   &priv->rx_addr, GFP_KERNEL);
-		if (!priv->rx_bufs)
+		if (!priv->rx_bufs) {
+			ret = -EINVAL;
 			goto err;
+		}
 		priv->tx_size = UART_XMIT_SIZE;
 		priv->tx_buf = dma_alloc_coherent(dev,
 						  priv->tx_size,
 						  &priv->tx_addr, GFP_KERNEL);
-		if (!priv->tx_buf)
+		if (!priv->tx_buf) {
+			ret = -EINVAL;
 			goto err;
+		}
 	}
 
 	ret = serial8250_register_8250_port(&up);
@@ -1095,6 +1099,7 @@ static int brcmuart_probe(struct platform_device *pdev)
 	if (priv->dma_enabled) {
 		dma_irq = platform_get_irq_byname(pdev,  "dma");
 		if (dma_irq < 0) {
+			ret = dma_irq;
 			dev_err(dev, "no IRQ resource info\n");
 			goto err1;
 		}
@@ -1114,7 +1119,7 @@ static int brcmuart_probe(struct platform_device *pdev)
 err:
 	brcmuart_free_bufs(dev, priv);
 	brcmuart_arbitration(priv, 0);
-	return -ENODEV;
+	return ret;
 }
 
 static int brcmuart_remove(struct platform_device *pdev)
-- 
2.17.1


  parent reply	other threads:[~2021-12-24 14:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24 14:29 [PATCH 00/10] serial: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
2021-12-24 14:29 ` [PATCH 01/10] serial: altera: Use platform_get_irq_optional() to get the interrupt Lad Prabhakar
2021-12-24 14:29 ` [PATCH 02/10] serial: 8250_bcm7271: Use platform_get_irq() " Lad Prabhakar
2021-12-24 22:10   ` Florian Fainelli
2021-12-24 14:29 ` Lad Prabhakar [this message]
2021-12-24 22:11   ` [PATCH 03/10] serial: 8250_bcm7271: Propagate error codes from brcmuart_probe() Florian Fainelli
     [not found]   ` <CAHp75VdC+JifneoYRS3yoXoAhio+TXQzca3pku7ug=A_ewWrsg@mail.gmail.com>
2021-12-25 12:20     ` Lad, Prabhakar
2021-12-30 12:27       ` Greg Kroah-Hartman
2021-12-24 14:29 ` [PATCH 04/10] serial: meson: Use platform_get_irq() to get the interrupt Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 14:29 ` [PATCH 05/10] serial: pxa: " Lad Prabhakar
2021-12-24 14:29 ` [PATCH 06/10] serial: altera_jtaguart: Use platform_get_irq_optional() " Lad Prabhakar
2021-12-24 14:29 ` [PATCH 07/10] serial: vt8500: Use platform_get_irq() " Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 14:29 ` [PATCH 08/10] serial: ar933x: " Lad Prabhakar
2021-12-24 14:29 ` [PATCH 09/10] serial: bcm63xx: " Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 17:05   ` Florian Fainelli
2021-12-24 17:05     ` Florian Fainelli
2021-12-24 14:29 ` [PATCH 10/10] serial: pmac_zilog: " Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211224142917.6966-4-prabhakar.mahadev-lad.rj@bp.renesas.com \
    --to=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.