From: Sudeep Holla Date: Mon, 17 Mar 2025 10:31:21 +0000 (+0000) Subject: firmware: arm_scmi: Ensure scmi_devices are always matched by name as well X-Git-Tag: v6.16-rc1~100^2~23^2~16 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=db28d02c4017560761d345fa2f28d728139d4e9d;p=linux-block.git firmware: arm_scmi: Ensure scmi_devices are always matched by name as well Currently, devices without a name in the id_table cannot register drivers, and no scmi_device is created without a name via scmi_device_create(). However, the function __scmi_device_create() allows devices with no name, which are then labeled as "unknown." Removes support for matching scmi_device instances without a name, ensuring consistency across the driver registration and probing process. Message-Id: <20250317-b4-scmi_minor_cleanup-v2-1-f4be99bd9864@arm.com> Signed-off-by: Sudeep Holla --- diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 7af01664ce7e..fada4cf0cef7 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -209,13 +209,10 @@ scmi_dev_match_id(struct scmi_device *scmi_dev, const struct scmi_driver *scmi_d if (!id) return NULL; - for (; id->protocol_id; id++) - if (id->protocol_id == scmi_dev->protocol_id) { - if (!id->name) - return id; - else if (!strcmp(id->name, scmi_dev->name)) - return id; - } + for (; id->protocol_id && id->name; id++) + if (id->protocol_id == scmi_dev->protocol_id && + !strcmp(id->name, scmi_dev->name)) + return id; return NULL; }