ASoC: soc.h: replace custom COUNT_ARGS() & CONCATENATE() implementations
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 4 Sep 2023 11:15:24 +0000 (14:15 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 11 Sep 2023 00:29:59 +0000 (01:29 +0100)
Replace custom implementation of the macros from args.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20230904111524.1740930-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h

index fa2337a3cf4c775b566e1d133844b5dcefb1516a..509386ff5212bbb8a44aa0d9e018b4e236c9ced3 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef __LINUX_SND_SOC_H
 #define __LINUX_SND_SOC_H
 
+#include <linux/args.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/types.h>
@@ -870,12 +871,8 @@ asoc_link_to_platform(struct snd_soc_dai_link *link, int n) {
        .platforms      = platform,                     \
        .num_platforms  = ARRAY_SIZE(platform)
 
-#define SND_SOC_DAILINK_REGx(_1, _2, _3, func, ...) func
 #define SND_SOC_DAILINK_REG(...) \
-       SND_SOC_DAILINK_REGx(__VA_ARGS__,               \
-                       SND_SOC_DAILINK_REG3,   \
-                       SND_SOC_DAILINK_REG2,   \
-                       SND_SOC_DAILINK_REG1)(__VA_ARGS__)
+       CONCATENATE(SND_SOC_DAILINK_REG, COUNT_ARGS(__VA_ARGS__))(__VA_ARGS__)
 
 #define SND_SOC_DAILINK_DEF(name, def...)              \
        static struct snd_soc_dai_link_component name[] = { def }