All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform
@ 2013-03-27 11:02 Lars-Peter Clausen
  2013-03-27 11:02 ` [PATCH 2/3] ASoC: Constify the 'ops' field of snd_soc_platform_driver Lars-Peter Clausen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-03-27 11:02 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Vinod Koul, alsa-devel, Lars-Peter Clausen

The ASoC core does no not modify the driver of a platform. Making it const
allows ASoC platform drivers to declare the snd_soc_platform_driver struct as
const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/sound/soc.h  | 4 ++--
 sound/soc/soc-core.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1ffe9d4..e666119 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -373,7 +373,7 @@ int snd_soc_suspend(struct device *dev);
 int snd_soc_resume(struct device *dev);
 int snd_soc_poweroff(struct device *dev);
 int snd_soc_register_platform(struct device *dev,
-		struct snd_soc_platform_driver *platform_drv);
+		const struct snd_soc_platform_driver *platform_drv);
 void snd_soc_unregister_platform(struct device *dev);
 int snd_soc_register_codec(struct device *dev,
 		const struct snd_soc_codec_driver *codec_drv,
@@ -829,7 +829,7 @@ struct snd_soc_platform {
 	const char *name;
 	int id;
 	struct device *dev;
-	struct snd_soc_platform_driver *driver;
+	const struct snd_soc_platform_driver *driver;
 	struct mutex mutex;
 
 	unsigned int suspended:1; /* platform is suspended */
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 561d589..7bf21a1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3905,7 +3905,7 @@ static void snd_soc_unregister_dais(struct device *dev, size_t count)
  * @platform: platform to register
  */
 int snd_soc_register_platform(struct device *dev,
-		struct snd_soc_platform_driver *platform_drv)
+		const struct snd_soc_platform_driver *platform_drv)
 {
 	struct snd_soc_platform *platform;
 
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] ASoC: Constify the 'ops' field of snd_soc_platform_driver
  2013-03-27 11:02 [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform Lars-Peter Clausen
@ 2013-03-27 11:02 ` Lars-Peter Clausen
  2013-03-27 11:02 ` [PATCH 3/3] ASoC: Constify the 'compr_ops' " Lars-Peter Clausen
  2013-03-27 23:09 ` [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-03-27 11:02 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Vinod Koul, alsa-devel, Lars-Peter Clausen

The ASoC core does not modify a platform driver's ops structure. Making it const
allows ASoC platform drivers to declare their snd_pcm_ops struct as const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/sound/soc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index e666119..eae9c10 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -807,7 +807,7 @@ struct snd_soc_platform_driver {
 		struct snd_soc_dai *);
 
 	/* platform stream pcm ops */
-	struct snd_pcm_ops *ops;
+	const struct snd_pcm_ops *ops;
 
 	/* platform stream compress ops */
 	struct snd_compr_ops *compr_ops;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] ASoC: Constify the 'compr_ops' field of snd_soc_platform_driver
  2013-03-27 11:02 [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform Lars-Peter Clausen
  2013-03-27 11:02 ` [PATCH 2/3] ASoC: Constify the 'ops' field of snd_soc_platform_driver Lars-Peter Clausen
@ 2013-03-27 11:02 ` Lars-Peter Clausen
  2013-03-27 23:09 ` [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-03-27 11:02 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Vinod Koul, alsa-devel, Lars-Peter Clausen

The ASoC core does not modify a platform driver's compr_ops structure. Making it
const allows ASoC platform drivers to declare their snd_compr_ops struct as
const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/sound/soc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index eae9c10..9eb0e4d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -810,7 +810,7 @@ struct snd_soc_platform_driver {
 	const struct snd_pcm_ops *ops;
 
 	/* platform stream compress ops */
-	struct snd_compr_ops *compr_ops;
+	const struct snd_compr_ops *compr_ops;
 
 	/* platform stream completion event */
 	int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform
  2013-03-27 11:02 [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform Lars-Peter Clausen
  2013-03-27 11:02 ` [PATCH 2/3] ASoC: Constify the 'ops' field of snd_soc_platform_driver Lars-Peter Clausen
  2013-03-27 11:02 ` [PATCH 3/3] ASoC: Constify the 'compr_ops' " Lars-Peter Clausen
@ 2013-03-27 23:09 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-03-27 23:09 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Vinod Koul, alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 256 bytes --]

On Wed, Mar 27, 2013 at 12:02:22PM +0100, Lars-Peter Clausen wrote:
> The ASoC core does no not modify the driver of a platform. Making it const
> allows ASoC platform drivers to declare the snd_soc_platform_driver struct as
> const.

Applied all, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-27 23:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27 11:02 [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform Lars-Peter Clausen
2013-03-27 11:02 ` [PATCH 2/3] ASoC: Constify the 'ops' field of snd_soc_platform_driver Lars-Peter Clausen
2013-03-27 11:02 ` [PATCH 3/3] ASoC: Constify the 'compr_ops' " Lars-Peter Clausen
2013-03-27 23:09 ` [PATCH 1/3] ASoC: Constify the 'driver' field of snd_soc_platform Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.