firmware: arm_scmi: Refactor device matching logic to eliminate duplication
authorSudeep Holla <sudeep.holla@arm.com>
Mon, 17 Mar 2025 10:31:22 +0000 (10:31 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 14 Apr 2025 09:12:01 +0000 (10:12 +0100)
commit3da2859ee5c94771bf8275a27febe56bedd4425a
treed3b779ae39798673348f37f994c9f88c2f2efd9c
parentdb28d02c4017560761d345fa2f28d728139d4e9d
firmware: arm_scmi: Refactor device matching logic to eliminate duplication

Currently, the device matching logic is duplicated in two functions:
  - scmi_dev_match() used by the scmi_bus to match scmi_devices with
    scmi_drivers.
  - scmi_child_dev_find() used to check for the presence of a device
    with the same name and protocol_id to avoid adding duplicates to
    the bus.

Refactor the code to eliminate the redundant matching logic and
consolidates the functionality for better maintainability and efficiency.

Message-Id: <20250317-b4-scmi_minor_cleanup-v2-2-f4be99bd9864@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/bus.c