From: Alfie Varghese <alfievarghese22@gmail.com>
To: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org
Cc: greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Alfie Varghese <alfievarghese22@gmail.com>
Subject: [PATCH] staging: greybus: uart: return tty_alloc_driver() errors
Date: Mon, 13 Jul 2026 22:38:45 +0530 [thread overview]
Message-ID: <20260713170845.1518-1-alfievarghese22@gmail.com> (raw)
gb_tty_init() maps any tty_alloc_driver() failure to -ENOMEM. This
loses the real errno returned by the driver core and makes failures
harder to diagnose correctly.
Return PTR_ERR(gb_tty_driver) instead so callers receive the actual
failure reason while preserving the existing cleanup path.
Signed-off-by: Alfie Varghese <alfievarghese22@gmail.com>
---
drivers/staging/greybus/uart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index 7d060b4cd33d..24b4dab069c3 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -951,7 +951,7 @@ static int gb_tty_init(void)
TTY_DRIVER_DYNAMIC_DEV);
if (IS_ERR(gb_tty_driver)) {
pr_err("Can not allocate tty driver\n");
- retval = -ENOMEM;
+ retval = PTR_ERR(gb_tty_driver);
goto fail_unregister_dev;
}
--
2.54.0.windows.1
next reply other threads:[~2026-07-13 17:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 17:08 Alfie Varghese [this message]
2026-07-14 7:04 ` Dan Carpenter
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=20260713170845.1518-1-alfievarghese22@gmail.com \
--to=alfievarghese22@gmail.com \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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
all inboxes | Powered by JetHome®