Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: cros_ec: Check DT node for usbpd-notify add

Add a check to ensure there is indeed an EC device tree entry before
adding the cros-usbpd-notify device. This covers configs where both
CONFIG_ACPI and CONFIG_OF are defined, but the EC device is defined
using device tree and not in ACPI.

Fixes: 4602dce0361e ("mfd: cros_ec: Add cros-usbpd-notify subdevice")
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Prashant Malani and committed by
Lee Jones
f8db89d1 873357b1

+1 -1
+1 -1
drivers/mfd/cros_ec_dev.c
··· 211 211 * explicitly added on platforms that don't have the PD notifier ACPI 212 212 * device entry defined. 213 213 */ 214 - if (IS_ENABLED(CONFIG_OF)) { 214 + if (IS_ENABLED(CONFIG_OF) && ec->ec_dev->dev->of_node) { 215 215 if (cros_ec_check_features(ec, EC_FEATURE_USB_PD)) { 216 216 retval = mfd_add_hotplug_devices(ec->dev, 217 217 cros_usbpd_notify_cells,