aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-13 07:53:40 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-13 08:00:30 +1100
commita64111a81dff5e37defbcbfcef638a011897f44e (patch)
treed0bb731e3a0c74d3c07e3479aca46730ec1a8dc9
parentbd186ee6b13b7eb7b41f8d0fe0f78abd177a12a8 (diff)
Refactor/tidy snd_avirt_private_data
Make void* audiopath a struct and_avirt_audiopath, standardize naming in the struct Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r--core.c11
-rw-r--r--pcm.c4
-rw-r--r--sound/avirt.h6
3 files changed, 11 insertions, 10 deletions
diff --git a/core.c b/core.c
index a99f82a..f3b33d1 100644
--- a/core.c
+++ b/core.c
@@ -202,14 +202,15 @@ static void destroy_snd_avirt_audiopath_obj(struct snd_avirt_audiopath_obj *p)
* pcm_private_data_free - callback function to free private data allocated to pcm
* @pcm: the PCM with private data
*/
-void pcm_private_data_free(struct snd_pcm *pcm)
+static void pcm_private_data_free(struct snd_pcm *pcm)
{
struct snd_avirt_private_data *avirt_private_data;
- D_PRINTK("Issuing free to private data struct");
- if(pcm->private_data){
+
+ D_PRINTK("Issuing free to private data struct");
+ if (pcm->private_data) {
avirt_private_data = pcm->private_data;
- if(avirt_private_data->ap_userdata)
- avirt_private_data->private_free(pcm);
+ if (avirt_private_data->ap_private_data)
+ avirt_private_data->ap_private_free(pcm);
}
kfree(pcm->private_data);
diff --git a/pcm.c b/pcm.c
index 73f87c9..509eae7 100644
--- a/pcm.c
+++ b/pcm.c
@@ -20,8 +20,8 @@
(ap)->pcm_ops->callback((substream), ##__VA_ARGS__) : \
0)
-#define PRIVATE_DATA(substream) \
- ((struct snd_avirt_private_data *) substream->private_data)
+#define PRIVATE_DATA(substream) \
+ ((struct snd_avirt_private_data *)substream->private_data)
/**
* snd_avirt_pcm_period_elapsed - PCM buffer complete callback
diff --git a/sound/avirt.h b/sound/avirt.h
index 52d2404..fd4ae32 100644
--- a/sound/avirt.h
+++ b/sound/avirt.h
@@ -67,10 +67,10 @@ struct snd_avirt_stream {
* Private Data Expansion
*/
struct snd_avirt_private_data {
- void *audiopath;
- void *ap_userdata;
+ struct snd_avirt_audiopath *audiopath;
+ void *ap_private_data;
- void (*private_free)(struct snd_pcm *pcm);
+ void (*ap_private_free)(struct snd_pcm *pcm);
};
/**