mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<patches@opensource.cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>
Subject: [PATCH 3/5] ASoC: cs42l42: Move cs42l42_supply_names to .c file
Date: Wed, 17 Aug 2022 13:23:45 +0100	[thread overview]
Message-ID: <20220817122347.1356773-4-rf@opensource.cirrus.com> (raw)
In-Reply-To: <20220817122347.1356773-1-rf@opensource.cirrus.com>

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@opensource.cirrus.com>
---
 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


  parent reply	other threads:[~2022-08-17 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 12:23 [PATCH 0/5] ASoC: cs42l42: Some small code improvements Richard Fitzgerald
2022-08-17 12:23 ` [PATCH 1/5] ASoC: cs42l42: Don't include kernel.h Richard Fitzgerald
2022-08-17 12:23 ` [PATCH 2/5] ASoC: cs42l42: Add include dependencies to cs42l42.h Richard Fitzgerald
2022-08-17 12:23 ` Richard Fitzgerald [this message]
2022-08-17 12:23 ` [PATCH 4/5] ASoC: cs42l42: Fix comment typo in cs42l42_slow_start_put() Richard Fitzgerald
2022-08-17 12:23 ` [PATCH 5/5] ASoC: cs42l42: Use snd_soc_tdm_params_to_bclk() Richard Fitzgerald
2022-08-17 17:05 ` [PATCH 0/5] ASoC: cs42l42: Some small code improvements Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220817122347.1356773-4-rf@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®