Unverified Commit abfbe5ee authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Ilpo Järvinen
Browse files

platform/x86: hp_accel: Check ACPI_COMPANION() against NULL



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
platform/x86 hp_accel driver.

Fixes: 8ebcb6c9 ("platform/x86: hp_accel: Convert to be a platform driver")
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/2425918.ElGaqSPkdT@rafael.j.wysocki


Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent e7a9a6ea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -300,6 +300,9 @@ static int lis3lv02d_probe(struct platform_device *device)
	int ret;

	lis3_dev.bus_priv = ACPI_COMPANION(&device->dev);
	if (!lis3_dev.bus_priv)
		return -ENODEV;

	lis3_dev.init = lis3lv02d_acpi_init;
	lis3_dev.read = lis3lv02d_acpi_read;
	lis3_dev.write = lis3lv02d_acpi_write;