From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Tony Lindgren <tony@atomide.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Dhruva Gole" <d-gole@ti.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"John Ogness" <john.ogness@linutronix.de>,
"Johan Hovold" <johan@kernel.org>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
linux-omap@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] serial: core: Fix error handling for serial_core_ctrl_device_add()
Date: Fri, 2 Jun 2023 17:53:51 +0300 [thread overview]
Message-ID: <ZHoCf50NnIeseQT8@smile.fi.intel.com> (raw)
In-Reply-To: <20230602070007.59268-1-tony@atomide.com>
On Fri, Jun 02, 2023 at 10:00:05AM +0300, Tony Lindgren wrote:
> Checking for NULL is incorrect as serial_base_ctrl_add() uses ERR_PTR().
>
> Let's also pass any returned error along, there's no reason to translate
> all errors to -ENODEV.
Jiri already asked the same question I have had on a glance, and this all
solved here, so
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>
> Changes since v1:
>
> - Stop translating all errors to -ENODEV
>
> - There's no need to use IS_ERR_OR_NULL() as noted by Jiri
>
> ---
> drivers/tty/serial/serial_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -3342,8 +3342,8 @@ int serial_core_register_port(struct uart_driver *drv, struct uart_port *port)
> ctrl_dev = serial_core_ctrl_find(drv, port->dev, port->ctrl_id);
> if (!ctrl_dev) {
> new_ctrl_dev = serial_core_ctrl_device_add(port);
> - if (!new_ctrl_dev) {
> - ret = -ENODEV;
> + if (IS_ERR(new_ctrl_dev)) {
> + ret = PTR_ERR(new_ctrl_dev);
> goto err_unlock;
> }
> ctrl_dev = new_ctrl_dev;
> --
> 2.41.0
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2023-06-02 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 7:00 [PATCH v2 1/1] serial: core: Fix error handling for serial_core_ctrl_device_add() Tony Lindgren
2023-06-02 7:22 ` Jiri Slaby
2023-06-02 14:53 ` Andy Shevchenko [this message]
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=ZHoCf50NnIeseQT8@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bigeasy@linutronix.de \
--cc=d-gole@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=johan@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=tony@atomide.com \
--cc=vigneshr@ti.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