]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: Intel: catpt: Simplify catpt_stream_read_position()
authorCezary Rojewski <cezary.rojewski@intel.com>
Fri, 12 Dec 2025 10:38:56 +0000 (11:38 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 14 Dec 2025 10:34:57 +0000 (19:34 +0900)
Add position to the argument list to simplify the wrapper.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20251212103858.110701-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/catpt/pcm.c

index cc43346f83af4c0d4b5e472726f6f77a7180c545..cbb1c39424095d6cf612b40cc5c3aeae8aa65d60 100644 (file)
@@ -114,14 +114,10 @@ catpt_stream_find(struct catpt_dev *cdev, u8 stream_hw_id)
        return result;
 }
 
-static u32 catpt_stream_read_position(struct catpt_dev *cdev,
-                                     struct catpt_stream_runtime *stream)
+static void catpt_stream_read_position(struct catpt_dev *cdev,
+                                      struct catpt_stream_runtime *stream, u32 *pos)
 {
-       u32 pos;
-
-       memcpy_fromio(&pos, cdev->lpe_ba + stream->info.read_pos_regaddr,
-                     sizeof(pos));
-       return pos;
+       memcpy_fromio(pos, cdev->lpe_ba + stream->info.read_pos_regaddr, sizeof(*pos));
 }
 
 static u32 catpt_stream_volume(struct catpt_dev *cdev,
@@ -615,7 +611,7 @@ catpt_component_pointer(struct snd_soc_component *component,
                return 0;
 
        stream = snd_soc_dai_get_dma_data(cpu_dai, substream);
-       pos = catpt_stream_read_position(cdev, stream);
+       catpt_stream_read_position(cdev, stream, &pos);
 
        return bytes_to_frames(substream->runtime, pos);
 }