Re: [PATCH v1] ACPI: driver: Check ACPI_COMPANION() against NULL during probe

From: Andy Shevchenko

Date: Sun May 10 2026 - 02:19:23 EST


On Fri, May 08, 2026 at 08:04:33PM +0200, Rafael J. Wysocki wrote:

> Since 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(),
> platform drivers that rely on the existence of a device's ACPI companion
> object should verify its presence.
>
> Accordingly, add requisite ACPI_COMPANION() or ACPI_HANDLE() checks
> against NULL to 13 platform drivers handling core ACPI devices.
>
> Also change the value returned by the ACPI thermal zone driver when
> the device's ACPI companion is not present to -ENODEV for consistency
> with the other drivers.

Yeah, or somehow to disable that matching.
As a (quick) fix this patch seems fine to me.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko