From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Subject: [PATCH v1 2/5] tty: rpmsg: Unify variable used to keep an error code
Date: Mon, 25 Oct 2021 16:51:45 +0300 [thread overview]
Message-ID: <20211025135148.53944-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20211025135148.53944-1-andriy.shevchenko@linux.intel.com>
In some ret is used, in the other err. Let's unify it across the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/rpmsg_tty.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/tty/rpmsg_tty.c b/drivers/tty/rpmsg_tty.c
index 8c17ddbf371d..fc5d33dc4cb8 100644
--- a/drivers/tty/rpmsg_tty.c
+++ b/drivers/tty/rpmsg_tty.c
@@ -114,22 +114,22 @@ static const struct tty_operations rpmsg_tty_ops = {
static struct rpmsg_tty_port *rpmsg_tty_alloc_cport(void)
{
struct rpmsg_tty_port *cport;
- int err;
+ int ret;
cport = kzalloc(sizeof(*cport), GFP_KERNEL);
if (!cport)
return ERR_PTR(-ENOMEM);
mutex_lock(&idr_lock);
- err = idr_alloc(&tty_idr, cport, 0, MAX_TTY_RPMSG, GFP_KERNEL);
+ ret = idr_alloc(&tty_idr, cport, 0, MAX_TTY_RPMSG, GFP_KERNEL);
mutex_unlock(&idr_lock);
- if (err < 0) {
+ if (ret < 0) {
kfree(cport);
- return ERR_PTR(err);
+ return ERR_PTR(ret);
}
- cport->id = err;
+ cport->id = ret;
return cport;
}
@@ -217,7 +217,7 @@ static struct rpmsg_driver rpmsg_tty_rpmsg_drv = {
static int __init rpmsg_tty_init(void)
{
- int err;
+ int ret;
rpmsg_tty_driver = tty_alloc_driver(MAX_TTY_RPMSG, TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV);
@@ -236,15 +236,15 @@ static int __init rpmsg_tty_init(void)
tty_set_operations(rpmsg_tty_driver, &rpmsg_tty_ops);
- err = tty_register_driver(rpmsg_tty_driver);
- if (err < 0) {
- pr_err("Couldn't install rpmsg tty driver: err %d\n", err);
+ ret = tty_register_driver(rpmsg_tty_driver);
+ if (ret < 0) {
+ pr_err("Couldn't install rpmsg tty driver: %d\n", ret);
goto error_put;
}
- err = register_rpmsg_driver(&rpmsg_tty_rpmsg_drv);
- if (err < 0) {
- pr_err("Couldn't register rpmsg tty driver: err %d\n", err);
+ ret = register_rpmsg_driver(&rpmsg_tty_rpmsg_drv);
+ if (ret < 0) {
+ pr_err("Couldn't register rpmsg tty driver: %d\n", ret);
goto error_unregister;
}
@@ -256,7 +256,7 @@ static int __init rpmsg_tty_init(void)
error_put:
tty_driver_kref_put(rpmsg_tty_driver);
- return err;
+ return ret;
}
static void __exit rpmsg_tty_exit(void)
--
2.33.0
next prev parent reply other threads:[~2021-10-25 13:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 13:51 [PATCH v1 1/5] tty: rpmsg: Assign returned id to a local variable Andy Shevchenko
2021-10-25 13:51 ` Andy Shevchenko [this message]
2021-10-25 13:51 ` [PATCH v1 3/5] tty: rpmsg: Use dev_err_probe() in ->probe() Andy Shevchenko
2021-10-25 13:51 ` [PATCH v1 4/5] tty: rpmsg: Add pr_fmt() to prefix messages Andy Shevchenko
2021-10-25 13:51 ` [PATCH v1 5/5] tty: rpmsg: Define tty name via constant string literal Andy Shevchenko
2021-11-02 13:19 ` [PATCH v1 1/5] tty: rpmsg: Assign returned id to a local variable Arnaud POULIQUEN
2021-11-02 14:40 ` Andy Shevchenko
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=20211025135148.53944-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnaud.pouliquen@foss.st.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox