public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: Tim Harvey <tharvey@gateworks.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	 Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	 Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	 Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
	 Baojun Xu <baojun.xu@ti.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	 Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	 Alexandre Torgue <alexandre.torgue@foss.st.com>,
	 Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	 Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-sound@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 alsa-devel@alsa-project.org,
	linux-stm32@st-md-mailman.stormreply.com,
	 Javier Carrasco <javier.carrasco.cruz@gmail.com>
Subject: [PATCH v2 1/2] media: i2c: tda1997x: constify snd_soc_component_driver struct
Date: Mon, 29 Jul 2024 11:37:37 +0200	[thread overview]
Message-ID: <20240729-const_snd_soc_component_driver-v2-1-1994f44f1ec2@gmail.com> (raw)
In-Reply-To: <20240729-const_snd_soc_component_driver-v2-0-1994f44f1ec2@gmail.com>

`tda1997x_codec_driver` is not modified after its declaration, and it
is only passed to `devm_snd_soc_register_component()`, which expects
a constant `snd_soc_component_driver`.

Move `tda1997x_codec_driver` to a read-only section by declaring it
const.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/media/i2c/tda1997x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 58ce8fec3041..3b7e5ff5b010 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -2514,7 +2514,7 @@ static void tda1997x_codec_remove(struct snd_soc_component *component)
 {
 }
 
-static struct snd_soc_component_driver tda1997x_codec_driver = {
+static const struct snd_soc_component_driver tda1997x_codec_driver = {
 	.probe			= tda1997x_codec_probe,
 	.remove			= tda1997x_codec_remove,
 	.idle_bias_on		= 1,

-- 
2.43.0


  reply	other threads:[~2024-07-29  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29  9:37 [PATCH v2 0/2] {ASoC,media}: constify snd_soc_component_driver when used as read-only Javier Carrasco
2024-07-29  9:37 ` Javier Carrasco [this message]
2024-07-29  9:37 ` [PATCH v2 2/2] ASoC: constify snd_soc_component_driver struct Javier Carrasco
2024-10-01 17:53 ` [PATCH v2 0/2] {ASoC,media}: constify snd_soc_component_driver when used as read-only 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=20240729-const_snd_soc_component_driver-v2-1-1994f44f1ec2@gmail.com \
    --to=javier.carrasco.cruz@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=baojun.xu@ti.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mchehab@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mhiramat@kernel.org \
    --cc=olivier.moysan@foss.st.com \
    --cc=perex@perex.cz \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=shenghao-ding@ti.com \
    --cc=tharvey@gateworks.com \
    --cc=tiwai@suse.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