aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel/hda-probes.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2022-02-09 08:31:04 +0200
committerMark Brown <broonie@kernel.org>2022-02-09 14:36:14 +0000
commit7d88b9608142f95ccdd3dfb190da4a5faddb1cc7 (patch)
tree547c877e53d5165bc2721fa3fcc82c85b21f9b25 /sound/soc/sof/intel/hda-probes.c
parent960a89045e146025f019647d3305b7eeddde68c6 (diff)
downloadlinux-7d88b9608142f95ccdd3dfb190da4a5faddb1cc7.tar.gz
ASoC: SOF: Intel: hdac_ext_stream: consistent prefixes for variables/members
The existing code maximizes confusion by using 'stream' and 'hstream' variables of different types, e.g: struct hdac_stream *stream; struct hdac_ext_stream *stream; struct hdac_stream *hstream; struct hdac_ext_stream *hstream; This confusion is partly inherited from legacy code but SOF contributors added their own creative spin, e.g. struct hdac_ext_stream *link_dev; struct hdac_ext_stream *dsp_stream; struct hdac_ext_stream hda_stream; and my personal favorite: stream = &hda_stream->hda_stream; This patch suggests a consistent naming across all Intel code related to HDAudio stream management. The convention is - by hierarchical order: struct sof_intel_hda_stream *hda_stream; struct hdac_ext_stream *hext_stream; struct hdac_stream *hstream; No functionality change - just renaming of variables/members. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220209063104.9971-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda-probes.c')
-rw-r--r--sound/soc/sof/intel/hda-probes.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/sound/soc/sof/intel/hda-probes.c b/sound/soc/sof/intel/hda-probes.c
index fe2f3f7d236b..35e548da3609 100644
--- a/sound/soc/sof/intel/hda-probes.c
+++ b/sound/soc/sof/intel/hda-probes.c
@@ -23,34 +23,34 @@ int hda_probe_compr_assign(struct snd_sof_dev *sdev,
struct snd_compr_stream *cstream,
struct snd_soc_dai *dai)
{
- struct hdac_ext_stream *stream;
+ struct hdac_ext_stream *hext_stream;
- stream = hda_dsp_stream_get(sdev, cstream->direction, 0);
- if (!stream)
+ hext_stream = hda_dsp_stream_get(sdev, cstream->direction, 0);
+ if (!hext_stream)
return -EBUSY;
- hdac_stream(stream)->curr_pos = 0;
- hdac_stream(stream)->cstream = cstream;
- cstream->runtime->private_data = stream;
+ hdac_stream(hext_stream)->curr_pos = 0;
+ hdac_stream(hext_stream)->cstream = cstream;
+ cstream->runtime->private_data = hext_stream;
- return hdac_stream(stream)->stream_tag;
+ return hdac_stream(hext_stream)->stream_tag;
}
int hda_probe_compr_free(struct snd_sof_dev *sdev,
struct snd_compr_stream *cstream,
struct snd_soc_dai *dai)
{
- struct hdac_ext_stream *stream = hda_compr_get_stream(cstream);
+ struct hdac_ext_stream *hext_stream = hda_compr_get_stream(cstream);
int ret;
ret = hda_dsp_stream_put(sdev, cstream->direction,
- hdac_stream(stream)->stream_tag);
+ hdac_stream(hext_stream)->stream_tag);
if (ret < 0) {
dev_dbg(sdev->dev, "stream put failed: %d\n", ret);
return ret;
}
- hdac_stream(stream)->cstream = NULL;
+ hdac_stream(hext_stream)->cstream = NULL;
cstream->runtime->private_data = NULL;
return 0;
@@ -61,8 +61,8 @@ int hda_probe_compr_set_params(struct snd_sof_dev *sdev,
struct snd_compr_params *params,
struct snd_soc_dai *dai)
{
- struct hdac_ext_stream *stream = hda_compr_get_stream(cstream);
- struct hdac_stream *hstream = hdac_stream(stream);
+ struct hdac_ext_stream *hext_stream = hda_compr_get_stream(cstream);
+ struct hdac_stream *hstream = hdac_stream(hext_stream);
struct snd_dma_buffer *dmab;
u32 bits, rate;
int bps, ret;
@@ -80,7 +80,7 @@ int hda_probe_compr_set_params(struct snd_sof_dev *sdev,
hstream->period_bytes = cstream->runtime->fragment_size;
hstream->no_period_wakeup = 0;
- ret = hda_dsp_stream_hw_params(sdev, stream, dmab, NULL);
+ ret = hda_dsp_stream_hw_params(sdev, hext_stream, dmab, NULL);
if (ret < 0) {
dev_err(sdev->dev, "error: hdac prepare failed: %d\n", ret);
return ret;
@@ -93,9 +93,9 @@ int hda_probe_compr_trigger(struct snd_sof_dev *sdev,
struct snd_compr_stream *cstream, int cmd,
struct snd_soc_dai *dai)
{
- struct hdac_ext_stream *stream = hda_compr_get_stream(cstream);
+ struct hdac_ext_stream *hext_stream = hda_compr_get_stream(cstream);
- return hda_dsp_stream_trigger(sdev, stream, cmd);
+ return hda_dsp_stream_trigger(sdev, hext_stream, cmd);
}
int hda_probe_compr_pointer(struct snd_sof_dev *sdev,
@@ -103,11 +103,11 @@ int hda_probe_compr_pointer(struct snd_sof_dev *sdev,
struct snd_compr_tstamp *tstamp,
struct snd_soc_dai *dai)
{
- struct hdac_ext_stream *stream = hda_compr_get_stream(cstream);
+ struct hdac_ext_stream *hext_stream = hda_compr_get_stream(cstream);
struct snd_soc_pcm_stream *pstream;
pstream = &dai->driver->capture;
- tstamp->copied_total = hdac_stream(stream)->curr_pos;
+ tstamp->copied_total = hdac_stream(hext_stream)->curr_pos;
tstamp->sampling_rate = snd_pcm_rate_bit_to_rate(pstream->rates);
return 0;