]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
soundwire: Use snd_soc_substream_to_rtd() to obtain rtd
authorCezary Rojewski <cezary.rojewski@intel.com>
Mon, 19 Feb 2024 10:52:06 +0000 (11:52 +0100)
committerVinod Koul <vkoul@kernel.org>
Sun, 3 Mar 2024 13:59:28 +0000 (19:29 +0530)
Utilize the helper function instead of casting from ->private_data
directly.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20240219105206.335738-1-cezary.rojewski@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/stream.c

index f9c0adc0738db27a7578509edbfbcd82c60b5206..4e9e7d2a942d8aa8a6d630a9e238916aaa699033 100644 (file)
@@ -1718,7 +1718,7 @@ EXPORT_SYMBOL(sdw_deprepare_stream);
 static int set_stream(struct snd_pcm_substream *substream,
                      struct sdw_stream_runtime *sdw_stream)
 {
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
        struct snd_soc_dai *dai;
        int ret = 0;
        int i;
@@ -1771,7 +1771,7 @@ EXPORT_SYMBOL(sdw_alloc_stream);
 int sdw_startup_stream(void *sdw_substream)
 {
        struct snd_pcm_substream *substream = sdw_substream;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
        struct sdw_stream_runtime *sdw_stream;
        char *name;
        int ret;
@@ -1815,7 +1815,7 @@ EXPORT_SYMBOL(sdw_startup_stream);
 void sdw_shutdown_stream(void *sdw_substream)
 {
        struct snd_pcm_substream *substream = sdw_substream;
-       struct snd_soc_pcm_runtime *rtd = substream->private_data;
+       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
        struct sdw_stream_runtime *sdw_stream;
        struct snd_soc_dai *dai;