From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Jiale Yao <yaojiale02@163.com>
Cc: Bhanu Prakash Maiya <bhanumaiya@chromium.org>,
Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
Prashant Malani <pmalani@chromium.org>,
Mark Hasemeyer <markhas@chromium.org>,
chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 1/2] platform/chrome: cros_ec_uart: check ACPI companion before use
Date: Thu, 29 Oct 2026 03:20:15 +0000 [thread overview]
Message-ID: <auK7bwHt8_qPThml@google.com> (raw)
In-Reply-To: <20261028051200.145621-2-yaojiale02@163.com>
On Wed, Oct 28, 2026 at 01:11:59PM +0800, Jiale Yao wrote:
> diff --git a/drivers/platform/chrome/cros_ec_uart.c b/drivers/platform/chrome/cros_ec_uart.c
> index d5b37414ff12..779aabd16674 100644
> --- a/drivers/platform/chrome/cros_ec_uart.c
> +++ b/drivers/platform/chrome/cros_ec_uart.c
> @@ -223,9 +223,13 @@ static int cros_ec_uart_resource(struct acpi_resource *ares, void *data)
>
> static int cros_ec_uart_acpi_probe(struct cros_ec_uart *ec_uart)
> {
> - int ret;
> + struct acpi_device *adev;
> LIST_HEAD(resources);
> - struct acpi_device *adev = ACPI_COMPANION(&ec_uart->serdev->dev);
> + int ret;
> +
> + adev = ACPI_COMPANION(&ec_uart->serdev->dev);
> + if (!adev)
> + return -ENODEV;
>
> ret = acpi_dev_get_resources(adev, &resources, cros_ec_uart_resource, ec_uart);
> if (ret < 0)
NACK, acpi_dev_get_resources() already checks `adev` and return an error
if it is NULL.
next prev parent reply other threads:[~2026-10-29 3:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 5:11 [PATCH 0/2] platform/chrome: check ACPI companions before use Jiale Yao
2026-10-28 5:11 ` [PATCH 1/2] platform/chrome: cros_ec_uart: check ACPI companion " Jiale Yao
2026-10-29 3:20 ` Tzung-Bi Shih [this message]
2026-10-28 5:12 ` [PATCH 2/2] platform/chrome: cros_usbpd_notify: check ACPI companion Jiale Yao
2026-10-29 3:19 ` Tzung-Bi Shih
-- strict thread matches above, loose matches on Subject: below --
2026-10-28 5:10 [PATCH 1/2] platform/chrome: cros_ec_uart: check ACPI companion before use Jiale Yao
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=auK7bwHt8_qPThml@google.com \
--to=tzungbi@kernel.org \
--cc=bhanumaiya@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markhas@chromium.org \
--cc=pmalani@chromium.org \
--cc=stable@vger.kernel.org \
--cc=yaojiale02@163.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