Linux ACPI
 help / color / mirror / Atom feed
* [PATCH v1 0/3] platform/chrome: Check ACPI_COMPANION() against NULL at probe time
@ 2026-05-12 16:34 Rafael J. Wysocki
  2026-05-12 16:35 ` [PATCH v1 1/3] platform/chrome: chromeos_privacy_screen: Check ACPI_COMPANION() Rafael J. Wysocki
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2026-05-12 16:34 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Linux ACPI, LKML, Andy Shevchenko, Benson Leung, chrome-platform

Hi All,

This series fixes up three platform/chrome drivers recently converted to
platform drivers to make them check the devices' ACPI companion objects at
probe time.

Thanks!




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/3] platform/chrome: chromeos_privacy_screen: Check ACPI_COMPANION()
  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 ` Rafael J. Wysocki
  2026-05-12 16:35 ` [PATCH v1 2/3] platform/chrome: chromeos_tbmc: " Rafael J. Wysocki
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2026-05-12 16:35 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Linux ACPI, LKML, Andy Shevchenko, Benson Leung, chrome-platform

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_privacy_screen driver.

Fixes: d3c2872ae323 ("platform/chrome: Convert ChromeOS privacy-screen driver to platform")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/chrome/chromeos_privacy_screen.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/platform/chrome/chromeos_privacy_screen.c
+++ b/drivers/platform/chrome/chromeos_privacy_screen.c
@@ -104,6 +104,9 @@ static const struct drm_privacy_screen_o
 
 static int chromeos_privacy_screen_probe(struct platform_device *pdev)
 {
+	if (!ACPI_COMPANION(&pdev->dev))
+		return -ENODEV;
+
 	struct drm_privacy_screen *drm_privacy_screen =
 		drm_privacy_screen_register(&pdev->dev,
 					    &chromeos_privacy_screen_ops,




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 2/3] platform/chrome: chromeos_tbmc: Check ACPI_COMPANION()
  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
  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
  3 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2026-05-12 16:35 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Linux ACPI, LKML, Andy Shevchenko, Benson Leung, chrome-platform

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;




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 3/3] platform/chrome: wilco_ec: event: Check ACPI_COMPANION()
  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 ` [PATCH v1 2/3] platform/chrome: chromeos_tbmc: " Rafael J. Wysocki
@ 2026-05-12 16:36 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2026-05-12 16:36 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Linux ACPI, LKML, Andy Shevchenko, Benson Leung, chrome-platform

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
wilco_ec event driver.

Fixes: 27d58498f690 ("platform/chrome: wilco_ec: event: Convert to a platform driver")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/platform/chrome/wilco_ec/event.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/platform/chrome/wilco_ec/event.c
+++ b/drivers/platform/chrome/wilco_ec/event.c
@@ -452,8 +452,13 @@ static void hangup_device(struct event_d
 static int event_device_probe(struct platform_device *pdev)
 {
 	struct event_device_data *dev_data;
+	struct acpi_device *adev;
 	int error, minor;
 
+	adev = ACPI_COMPANION(&pdev->dev);
+	if (!adev)
+		return -ENODEV;
+
 	minor = ida_alloc_max(&event_ida, EVENT_MAX_DEV-1, GFP_KERNEL);
 	if (minor < 0) {
 		error = minor;
@@ -494,8 +499,7 @@ static int event_device_probe(struct pla
 		goto free_dev_data;
 
 	/* Install an ACPI notify handler. */
-	error = acpi_dev_install_notify_handler(ACPI_COMPANION(&pdev->dev),
-						ACPI_DEVICE_NOTIFY,
+	error = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
 						event_device_notify, &pdev->dev);
 	if (error)
 		goto free_cdev;




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 0/3] platform/chrome: Check ACPI_COMPANION() against NULL at probe time
  2026-05-12 16:34 [PATCH v1 0/3] platform/chrome: Check ACPI_COMPANION() against NULL at probe time Rafael J. Wysocki
                   ` (2 preceding siblings ...)
  2026-05-12 16:36 ` [PATCH v1 3/3] platform/chrome: wilco_ec: event: " Rafael J. Wysocki
@ 2026-05-13  2:22 ` Tzung-Bi Shih
  3 siblings, 0 replies; 5+ messages in thread
From: Tzung-Bi Shih @ 2026-05-13  2:22 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux ACPI, LKML, Andy Shevchenko, Benson Leung, chrome-platform

On Tue, May 12, 2026 at 06:34:06PM +0200, Rafael J. Wysocki wrote:
> Hi All,
> 
> This series fixes up three platform/chrome drivers recently converted to
> platform drivers to make them check the devices' ACPI companion objects at
> probe time.
> 
> Thanks!
> 

Applied to

    https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next

[1/3] platform/chrome: chromeos_privacy_screen: Check ACPI_COMPANION()
      commit: 8a4a217f617b1ac2f8c095f33efd67d947ddb2cf
[2/3] platform/chrome: chromeos_tbmc: Check ACPI_COMPANION()
      commit: c15dbae7c856fb53cc6ffb86c6c64ebb816d07c8
[3/3] platform/chrome: wilco_ec: event: Check ACPI_COMPANION()
      commit: 51dcff9796fd486d7abf01081ca62e4072789e9d

Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-13  2:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v1 2/3] platform/chrome: chromeos_tbmc: " Rafael J. Wysocki
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox