[PATCH 3/5] ASoC: cs42l42: Move cs42l42_supply_names to .c file
From: Richard Fitzgerald
Date: Wed Aug 17 2022 - 08:24:08 EST
The array of supply name strings doesn't need to be in the header file.
Move it to the .c file.
Signed-off-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>
---
sound/soc/codecs/cs42l42.c | 9 +++++++++
sound/soc/codecs/cs42l42.h | 8 --------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 9032dd1b9d57..2235c17a0247 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -37,6 +37,14 @@
#include "cs42l42.h"
#include "cirrus_legacy.h"
+static const char * const cs42l42_supply_names[] = {
+ "VA",
+ "VP",
+ "VCP",
+ "VD_FILT",
+ "VL",
+};
+
static const struct reg_default cs42l42_reg_defaults[] = {
{ CS42L42_FRZ_CTL, 0x00 },
{ CS42L42_SRC_CTL, 0x10 },
@@ -2215,6 +2223,7 @@ static int cs42l42_i2c_probe(struct i2c_client *i2c_client)
return ret;
}
+ BUILD_BUG_ON(ARRAY_SIZE(cs42l42_supply_names) != ARRAY_SIZE(cs42l42->supplies));
for (i = 0; i < ARRAY_SIZE(cs42l42->supplies); i++)
cs42l42->supplies[i].supply = cs42l42_supply_names[i];
diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h
index 1d53e0e050ee..50299c9f283a 100644
--- a/sound/soc/codecs/cs42l42.h
+++ b/sound/soc/codecs/cs42l42.h
@@ -21,14 +21,6 @@
#include <sound/jack.h>
#include <sound/cs42l42.h>
-static const char *const cs42l42_supply_names[CS42L42_NUM_SUPPLIES] = {
- "VA",
- "VP",
- "VCP",
- "VD_FILT",
- "VL",
-};
-
struct cs42l42_private {
struct regmap *regmap;
struct device *dev;
--
2.30.2