* [PATCH v1 0/2] drivers: char: Check ACPI_COMPANION() against NULL at probe time
@ 2026-05-12 16:19 Rafael J. Wysocki
2026-05-12 16:20 ` [PATCH v1 1/2] hpet: " Rafael J. Wysocki
2026-05-12 16:20 ` [PATCH v1 2/2] sonypi: " Rafael J. Wysocki
0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-05-12 16:19 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Clemens Ladisch, Arnd Bergmann, Linux ACPI, LKML, Andy Shevchenko
Hi All,
This series fixes up two char drivers recently converted to platform drivers
to make them check the devices ACPI companion objects at probe time.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v1 1/2] hpet: Check ACPI_COMPANION() against NULL at probe time
2026-05-12 16:19 [PATCH v1 0/2] drivers: char: Check ACPI_COMPANION() against NULL at probe time Rafael J. Wysocki
@ 2026-05-12 16:20 ` Rafael J. Wysocki
2026-05-12 16:20 ` [PATCH v1 2/2] sonypi: " Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-05-12 16:20 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Clemens Ladisch, Arnd Bergmann, Linux ACPI, LKML, Andy Shevchenko
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
hpet driver.
Fixes: 71f0a267346b ("hpet: Convert ACPI driver to a platform one")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/char/hpet.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -976,10 +976,14 @@ static acpi_status hpet_resources(struct
static int hpet_acpi_probe(struct platform_device *pdev)
{
- struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+ struct acpi_device *device;
acpi_status result;
struct hpet_data data;
+ device = ACPI_COMPANION(&pdev->dev);
+ if (!device)
+ return -ENODEV;
+
memset(&data, 0, sizeof(data));
result =
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v1 2/2] sonypi: Check ACPI_COMPANION() against NULL at probe time
2026-05-12 16:19 [PATCH v1 0/2] drivers: char: Check ACPI_COMPANION() against NULL at probe time Rafael J. Wysocki
2026-05-12 16:20 ` [PATCH v1 1/2] hpet: " Rafael J. Wysocki
@ 2026-05-12 16:20 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-05-12 16:20 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Clemens Ladisch, Arnd Bergmann, Linux ACPI, LKML, Andy Shevchenko
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
sonypi driver.
Fixes: 7e488b0af021 ("sonypi: Convert ACPI driver to a platform one")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/char/sonypi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1117,7 +1117,11 @@ static int sonypi_disable(void)
#ifdef CONFIG_ACPI
static int sonypi_acpi_probe(struct platform_device *pdev)
{
- struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+ struct acpi_device *device;
+
+ device = ACPI_COMPANION(&pdev->dev);
+ if (!device)
+ return -ENODEV;
sonypi_acpi_device = device;
strcpy(acpi_device_name(device), "Sony laptop hotkeys");
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-12 16:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 16:19 [PATCH v1 0/2] drivers: char: Check ACPI_COMPANION() against NULL at probe time Rafael J. Wysocki
2026-05-12 16:20 ` [PATCH v1 1/2] hpet: " Rafael J. Wysocki
2026-05-12 16:20 ` [PATCH v1 2/2] sonypi: " Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox