[PATCH v2 5/9] firmware: arm_scmi: Fall back to ACPI HID when "compatible" is absent
Sudeep Holla <[email protected]>
| Newsgroups | org.kernel.vger.arm-scmi,org.infradead.lists.linux-arm-kernel |
|---|---|
| Message-ID | <[email protected]> |
scmi_debugfs_common_setup() uses the "compatible" property to populate the debugfs transport type string. ACPI-described SCMI devices do not provide that DT property, so the string remains NULL and debugfs setup falls through the allocation failure path. Check the property lookup result and use the ACPI HID as the fallback transport type for ACPI-described systems. Signed-off-by: Sudeep Holla <[email protected]> --- drivers/firmware/arm_scmi/driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 75dda6d5e8b1..04a0d8202504 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -3028,8 +3028,9 @@ static struct scmi_debug_info *scmi_debugfs_common_setup(struct scmi_info *info) return NULL; } - fwnode_property_read_string(dev_fwnode(info->dev), "compatible", - &c_ptr); + if (fwnode_property_read_string(dev_fwnode(info->dev), "compatible", + &c_ptr)) + c_ptr = acpi_device_hid(ACPI_COMPANION(info->dev)) ?: "unknown"; dbg->type = kstrdup(c_ptr, GFP_KERNEL); if (!dbg->type) { kfree(dbg->name); -- 2.43.0