Commit 2132dbc1 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: Intel: sof_sdw: Use for_each_set_bit

Rather than open coding a loop to process each bit use for_each_set_bit.
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240326160429.13560-10-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c577b747
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* sof_sdw - ASOC Machine driver for Intel SoundWire platforms * sof_sdw - ASOC Machine driver for Intel SoundWire platforms
*/ */
#include <linux/bitmap.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -1644,7 +1645,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) ...@@ -1644,7 +1645,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
char *codec_name, *codec_dai_name; char *codec_name, *codec_dai_name;
int i, j, be_id = 0; int i, j, be_id = 0;
int hdmi_num; int hdmi_num;
int ssp_mask; unsigned long ssp_mask;
int ret; int ret;
ret = get_dailink_info(dev, adr_link, &sdw_be_num, &codec_conf_num); ret = get_dailink_info(dev, adr_link, &sdw_be_num, &codec_conf_num);
...@@ -1782,12 +1783,10 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) ...@@ -1782,12 +1783,10 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
if (!ssp_num) if (!ssp_num)
goto DMIC; goto DMIC;
for (i = 0, j = 0; ssp_mask; i++, ssp_mask >>= 1) { j = 0;
for_each_set_bit(i, &ssp_mask, BITS_PER_TYPE(ssp_mask)) {
int playback, capture; int playback, capture;
if (!(ssp_mask & 0x1))
continue;
name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec", i); name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec", i);
cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", i); cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", i);
codec_name = devm_kasprintf(dev, GFP_KERNEL, "i2c-%s:0%d", codec_name = devm_kasprintf(dev, GFP_KERNEL, "i2c-%s:0%d",
......
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