Linux-Serial Archive mirror
 help / color / mirror / Atom feed
From: Parker Newman <parker@finest.io>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: Parker Newman <pnewman@connecttech.com>
Subject: [PATCH v1 2/4] serial: exar: use return dev_err_probe instead of returning error code
Date: Thu, 18 Apr 2024 11:36:29 -0400	[thread overview]
Message-ID: <69dce254723c80f69d4deef8512323a38aeeb7d1.1713452766.git.pnewman@connecttech.com> (raw)
In-Reply-To: <cover.1713452766.git.pnewman@connecttech.com>

From: Parker Newman <pnewman@connecttech.com>

Change to returning dev_err_probe() instead of returning the error code
after calling dev_err_probe().

Signed-off-by: Parker Newman <pnewman@connecttech.com>
---
 drivers/tty/serial/8250/8250_exar.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index a180741da634..01748ddbf729 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -1551,9 +1551,8 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)

 	nr_ports = exar_get_nr_ports(board, pcidev);
 	if (nr_ports == 0) {
-		dev_err_probe(&pcidev->dev, -ENODEV,
+		return dev_err_probe(&pcidev->dev, -ENODEV,
 				"failed to get number of ports\n");
-		return -ENODEV;
 	}

 	priv = devm_kzalloc(&pcidev->dev, struct_size(priv, line, nr_ports), GFP_KERNEL);
@@ -1587,9 +1586,8 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 	if (board->board_init) {
 		rc = board->board_init(priv, pcidev);
 		if (rc) {
-			dev_err_probe(&pcidev->dev, rc,
+			return dev_err_probe(&pcidev->dev, rc,
 					"failed to init serial board\n");
-			return rc;
 		}
 	}

--
2.43.2


  parent reply	other threads:[~2024-04-18 15:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 15:36 [PATCH v1 0/4] serial: exar: fix kbuild warnings and code style Parker Newman
2024-04-18 15:36 ` [PATCH v1 1/4] serial: exar: add missing kernel doc function parameters Parker Newman
2024-04-18 15:36 ` Parker Newman [this message]
2024-04-18 15:36 ` [PATCH v1 3/4] serial: exar: remove unneeded parenthesis Parker Newman
2024-04-19  6:58   ` Greg Kroah-Hartman
2024-04-19  7:01     ` Jiri Slaby
2024-04-19 12:50       ` Parker Newman
2024-04-18 15:36 ` [PATCH v1 4/4] serial: exar: change port_type ternary line wrapping Parker Newman
2024-04-19  6:07   ` Jiri Slaby
2024-04-19 12:17     ` Parker Newman
2024-04-19  6:57   ` Greg Kroah-Hartman

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=69dce254723c80f69d4deef8512323a38aeeb7d1.1713452766.git.pnewman@connecttech.com \
    --to=parker@finest.io \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pnewman@connecttech.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).