From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Benson Leung <bleung@chromium.org>,
chrome-platform@lists.linux.dev
Subject: [PATCH v1 2/3] platform/chrome: chromeos_tbmc: Check ACPI_COMPANION()
Date: Tue, 12 May 2026 18:35:54 +0200 [thread overview]
Message-ID: <1875121.VLH7GnMWUR@rafael.j.wysocki> (raw)
In-Reply-To: <3710526.iIbC2pHGDl@rafael.j.wysocki>
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Every platform driver can be forced to match a device that doesn't match
its list of device IDs because of device_match_driver_override(), so
platform drivers that rely on the existence of a device's ACPI companion
object need to verify its presence.
Accordingly, add a requisite ACPI_COMPANION() check against NULL to the
chromeos_tbmc driver.
Fixes: a2676ead257f ("platform/chrome: chromeos_tbmc: Convert to a platform driver")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/platform/chrome/chromeos_tbmc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/platform/chrome/chromeos_tbmc.c
+++ b/drivers/platform/chrome/chromeos_tbmc.c
@@ -69,9 +69,13 @@ static int chromeos_tbmc_probe(struct pl
{
struct input_dev *idev;
struct device *dev = &pdev->dev;
- struct acpi_device *adev = ACPI_COMPANION(dev);
+ struct acpi_device *adev;
int ret;
+ adev = ACPI_COMPANION(dev);
+ if (!adev)
+ return -ENODEV;
+
idev = devm_input_allocate_device(dev);
if (!idev)
return -ENOMEM;
next prev parent reply other threads:[~2026-05-12 16:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 16:34 [PATCH v1 0/3] platform/chrome: Check ACPI_COMPANION() against NULL at probe time Rafael J. Wysocki
2026-05-12 16:35 ` [PATCH v1 1/3] platform/chrome: chromeos_privacy_screen: Check ACPI_COMPANION() Rafael J. Wysocki
2026-05-12 16:35 ` Rafael J. Wysocki [this message]
2026-05-12 16:36 ` [PATCH v1 3/3] platform/chrome: wilco_ec: event: " Rafael J. Wysocki
2026-05-13 2:22 ` [PATCH v1 0/3] platform/chrome: Check ACPI_COMPANION() against NULL at probe time Tzung-Bi Shih
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=1875121.VLH7GnMWUR@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tzungbi@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