Skip to content

Commit 5b1b563

Browse files
plbossarttiwai
authored andcommitted
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
1 parent 9d94c58 commit 5b1b563

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sound/hda/intel-sdw-acpi.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,17 @@ static int
5656
sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
5757
{
5858
struct acpi_device *adev = acpi_fetch_acpi_dev(info->handle);
59+
struct fwnode_handle *fwnode;
5960
u8 count, i;
6061
int ret;
6162

6263
if (!adev)
6364
return -EINVAL;
6465

66+
fwnode = acpi_fwnode_handle(adev);
67+
6568
/* Found controller, find links supported */
66-
ret = fwnode_property_read_u8_array(acpi_fwnode_handle(adev),
67-
"mipi-sdw-master-count", &count, 1);
69+
ret = fwnode_property_read_u8_array(fwnode, "mipi-sdw-master-count", &count, 1);
6870

6971
/*
7072
* 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)
107109
continue;
108110
}
109111

110-
if (!is_link_enabled(acpi_fwnode_handle(adev), i)) {
112+
if (!is_link_enabled(fwnode, i)) {
111113
dev_dbg(&adev->dev,
112114
"Link %d not selected in firmware\n", i);
113115
continue;

0 commit comments

Comments
 (0)