summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2024-10-01 09:06:09 +0200
committerTakashi Iwai <tiwai@suse.de>2024-10-15 07:54:03 +0200
commit5b1b5631d8b68a5d7d4ef2c489377696596e89a1 (patch)
tree193080a4efc91179bab91b26ae16fc712f9e29cb /sound
parentALSA/hda: intel-sdw-acpi: cleanup sdw_intel_scan_controller (diff)
downloadlinux-5b1b5631d8b68a5d7d4ef2c489377696596e89a1.tar.xz
linux-5b1b5631d8b68a5d7d4ef2c489377696596e89a1.zip
ALSA/hda: intel-sdw-acpi: fetch fwnode once in sdw_intel_scan_controller()
Optimize a bit by using an intermediate 'fwnode' variable. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20241001070611.63288-3-yung-chuan.liao@linux.intel.com
Diffstat (limited to 'sound')
-rw-r--r--sound/hda/intel-sdw-acpi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/hda/intel-sdw-acpi.c b/sound/hda/intel-sdw-acpi.c
index 770dabe0124f..7a3735e94545 100644
--- a/sound/hda/intel-sdw-acpi.c
+++ b/sound/hda/intel-sdw-acpi.c
@@ -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;