linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: 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>,
	David Rhodes <david.rhodes@cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.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>,
	<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>, <patches@opensource.cirrus.com>,
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH 2/2] ASoC: constify snd_soc_component_driver struct
Date: Fri, 26 Jul 2024 09:13:53 +0100	[thread overview]
Message-ID: <ZqNawRmAqBRLIoQq@opensource.cirrus.com> (raw)
In-Reply-To: <20240725-const_snd_soc_component_driver-v1-2-3d7ee08e129b@gmail.com>

On Thu, Jul 25, 2024 at 12:31:40PM +0200, Javier Carrasco wrote:
> The instances of the `snd_soc_component_driver` struct are not modified
> after their declaration, and they are only passed to
> `devm_snd_soc_register_component()`, which expects a constant
> `snd_soc_component_driver`.
> 
> Move all instances of `snd_soc_component_driver` to read-only sections
> by declaring them const.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
>  sound/soc/codecs/cs43130.c           | 2 +-

> -static struct snd_soc_component_driver soc_component_dev_cs43130 = {
> +static const struct snd_soc_component_driver soc_component_dev_cs43130 = {
>  	.probe			= cs43130_probe,
>  	.controls		= cs43130_snd_controls,
>  	.num_controls		= ARRAY_SIZE(cs43130_snd_controls),

This won't work for cs43130, whilst what the driver does is
clearly slightly sketch it directly modifies this struct before
registering it with ASoC. That would need fixed first before this
change can be made.

Thanks,
Charles


  reply	other threads:[~2024-07-26  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25 10:31 [PATCH 0/2] {ASoC,media}: constify snd_soc_component_driver struct Javier Carrasco
2024-07-25 10:31 ` [PATCH 1/2] media: i2c: tda1997x: " Javier Carrasco
2024-07-25 10:31 ` [PATCH 2/2] ASoC: " Javier Carrasco
2024-07-26  8:13   ` Charles Keepax [this message]
2024-07-26  9:07     ` Javier Carrasco
2024-07-26  9:39   ` kernel test robot
2024-07-26 11:27   ` kernel test robot

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=ZqNawRmAqBRLIoQq@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.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=david.rhodes@cirrus.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=javier.carrasco.cruz@gmail.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=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --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;
as well as URLs for NNTP newsgroup(s).