From 988b5c7d2766bc0f98e8207f47c77f4f9a5fcc0a Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Thu, 12 Sep 2024 20:52:35 +0800 Subject: [PATCH] Revert "soundwire: stream: fix programming slave ports for non-continous port maps" This reverts commit ab8d66d132bc8f1992d3eb6cab8d32dda6733c84. --- drivers/soundwire/stream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index e79e3a4b76989f..fa7e86552c2e27 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -1301,18 +1301,18 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave, unsigned int port_num) { struct sdw_dpn_prop *dpn_prop; - unsigned long mask; + u8 num_ports; int i; if (direction == SDW_DATA_DIR_TX) { - mask = slave->prop.source_ports; + num_ports = hweight32(slave->prop.source_ports); dpn_prop = slave->prop.src_dpn_prop; } else { - mask = slave->prop.sink_ports; + num_ports = hweight32(slave->prop.sink_ports); dpn_prop = slave->prop.sink_dpn_prop; } - for_each_set_bit(i, &mask, 32) { + for (i = 0; i < num_ports; i++) { if (dpn_prop[i].num == port_num) return &dpn_prop[i]; }