Commit 5b1b5631 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai

ALSA/hda: intel-sdw-acpi: fetch fwnode once in sdw_intel_scan_controller()

Optimize a bit by using an intermediate 'fwnode' variable.
Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241001070611.63288-3-yung-chuan.liao@linux.intel.com
parent 9d94c583
......@@ -56,15 +56,17 @@ static int
sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
{
struct acpi_device *adev = acpi_fetch_acpi_dev(info->handle);
struct fwnode_handle *fwnode;
u8 count, i;
int ret;
if (!adev)
return -EINVAL;
fwnode = acpi_fwnode_handle(adev);
/* Found controller, find links supported */
ret = fwnode_property_read_u8_array(acpi_fwnode_handle(adev),
"mipi-sdw-master-count", &count, 1);
ret = fwnode_property_read_u8_array(fwnode, "mipi-sdw-master-count", &count, 1);
/*
* In theory we could check the number of links supported in
......@@ -107,7 +109,7 @@ sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
continue;
}
if (!is_link_enabled(acpi_fwnode_handle(adev), i)) {
if (!is_link_enabled(fwnode, i)) {
dev_dbg(&adev->dev,
"Link %d not selected in firmware\n", i);
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment