diff options
author | Prashant Malani <pmalani@chromium.org> | 2023-01-04 07:08:44 +0100 |
---|---|---|
committer | Prashant Malani <pmalani@chromium.org> | 2023-01-10 21:47:32 +0100 |
commit | ef9c00dbd383d2b68207cc996caa05c25c7894f5 (patch) | |
tree | 3e1d25f55d40dff69503e333b1c7adefff39f8aa /drivers/platform/chrome | |
parent | platform/chrome: cros_typec_vdm: Add VDM send support (diff) | |
download | linux-ef9c00dbd383d2b68207cc996caa05c25c7894f5.tar.xz linux-ef9c00dbd383d2b68207cc996caa05c25c7894f5.zip |
platform/chrome: cros_typec_switch: Use fwnode* prop check
Using device_property_present() multiple times on an ACPI device
leads to kernel panics on Chromebook systems. This happens when there
is > 1 boolean property in an ACPI device which is created dynamically
by the BIOS as part of SSDT[1] on Chromebook systems
Since fwnode_* can handle simple device tree properties equally
well, switch to using the fwnode_property_present() function
version. This will avoid panics and make the usage consistent
when we introduce a check for the 2nd property in a subsequent patch.
[1] https://wiki.osdev.org/SSDT
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20230104060846.112216-1-pmalani@chromium.org
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r-- | drivers/platform/chrome/cros_typec_switch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c index a26219e97c93..2536bda03bf3 100644 --- a/drivers/platform/chrome/cros_typec_switch.c +++ b/drivers/platform/chrome/cros_typec_switch.c @@ -254,7 +254,7 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata) dev_dbg(dev, "Retimer switch registered for index %llu\n", index); - if (!device_property_present(fwnode->dev, "mode-switch")) + if (!fwnode_property_present(fwnode, "mode-switch")) continue; ret = cros_typec_register_mode_switch(port, fwnode); |