From: Daniel Mack <daniel@zonque.org>
To: broonie@kernel.org
Cc: Daniel Mack <daniel@zonque.org>,
alsa-devel@alsa-project.org, robert.jarzmik@free.fr,
lgirdwood@gmail.com, haojian.zhuang@gmail.com
Subject: [PATCH 2/7] ASoC: pxa: clean up function names in pxa2xx-lib
Date: Wed, 27 Jun 2018 21:33:54 +0200 [thread overview]
Message-ID: <20180627193359.26631-3-daniel@zonque.org> (raw)
In-Reply-To: <20180627193359.26631-1-daniel@zonque.org>
Clean up the namespace a bit and drop the __ prefix of all functions
exported by pxa2xx-lib. This improves the readability of the code.
Signed-off-by: Daniel Mack <daniel@zonque.org>
---
include/sound/pxa2xx-lib.h | 10 +++++-----
sound/arm/pxa2xx-ac97.c | 10 +++++-----
sound/arm/pxa2xx-pcm-lib.c | 22 +++++++++++-----------
sound/soc/pxa/pxa2xx-pcm.c | 21 +++++++--------------
4 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/include/sound/pxa2xx-lib.h b/include/sound/pxa2xx-lib.h
index 63f75450d3db..b43de38de8b2 100644
--- a/include/sound/pxa2xx-lib.h
+++ b/include/sound/pxa2xx-lib.h
@@ -10,14 +10,14 @@ struct snd_pcm_substream;
struct snd_pcm_hw_params;
struct snd_pcm;
-extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
+extern int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
-extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream);
+extern int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream);
extern int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
extern snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream);
-extern int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
-extern int __pxa2xx_pcm_open(struct snd_pcm_substream *substream);
-extern int __pxa2xx_pcm_close(struct snd_pcm_substream *substream);
+extern int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
+extern int pxa2xx_pcm_open(struct snd_pcm_substream *substream);
+extern int pxa2xx_pcm_close(struct snd_pcm_substream *substream);
extern int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma);
extern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream);
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 7d8d7b7199dc..0d624337857b 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -70,7 +70,7 @@ static int pxa2xx_ac97_pcm_open(struct snd_pcm_substream *substream)
pxa2xx_audio_ops_t *platform_ops;
int ret, i;
- ret = __pxa2xx_pcm_open(substream);
+ ret = pxa2xx_pcm_open(substream);
if (ret)
return ret;
@@ -86,7 +86,7 @@ static int pxa2xx_ac97_pcm_open(struct snd_pcm_substream *substream)
if (platform_ops && platform_ops->startup) {
ret = platform_ops->startup(substream, platform_ops->priv);
if (ret < 0)
- __pxa2xx_pcm_close(substream);
+ pxa2xx_pcm_close(substream);
}
return ret;
@@ -110,7 +110,7 @@ static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream)
AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE;
int ret;
- ret = __pxa2xx_pcm_prepare(substream);
+ ret = pxa2xx_pcm_prepare(substream);
if (ret < 0)
return ret;
@@ -178,8 +178,8 @@ static const struct snd_pcm_ops pxa2xx_pcm_ops = {
.open = pxa2xx_ac97_pcm_open,
.close = pxa2xx_ac97_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
- .hw_params = __pxa2xx_pcm_hw_params,
- .hw_free = __pxa2xx_pcm_hw_free,
+ .hw_params = pxa2xx_pcm_hw_params,
+ .hw_free = pxa2xx_pcm_hw_free,
.prepare = pxa2xx_ac97_pcm_prepare,
.trigger = pxa2xx_pcm_trigger,
.pointer = pxa2xx_pcm_pointer,
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
index b927fa5ddbc0..dc56dbebf441 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/arm/pxa2xx-pcm-lib.c
@@ -33,8 +33,8 @@ static const struct snd_pcm_hardware pxa2xx_pcm_hardware = {
.fifo_size = 32,
};
-int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
+int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
{
struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -62,14 +62,14 @@ int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
return 0;
}
-EXPORT_SYMBOL(__pxa2xx_pcm_hw_params);
+EXPORT_SYMBOL(pxa2xx_pcm_hw_params);
-int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
+int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
{
snd_pcm_set_runtime_buffer(substream, NULL);
return 0;
}
-EXPORT_SYMBOL(__pxa2xx_pcm_hw_free);
+EXPORT_SYMBOL(pxa2xx_pcm_hw_free);
int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
@@ -84,13 +84,13 @@ pxa2xx_pcm_pointer(struct snd_pcm_substream *substream)
}
EXPORT_SYMBOL(pxa2xx_pcm_pointer);
-int __pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
+int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
{
return 0;
}
-EXPORT_SYMBOL(__pxa2xx_pcm_prepare);
+EXPORT_SYMBOL(pxa2xx_pcm_prepare);
-int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
+int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime;
@@ -127,13 +127,13 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
substream, dma_request_slave_channel(rtd->cpu_dai->dev,
dma_params->chan_name));
}
-EXPORT_SYMBOL(__pxa2xx_pcm_open);
+EXPORT_SYMBOL(pxa2xx_pcm_open);
-int __pxa2xx_pcm_close(struct snd_pcm_substream *substream)
+int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
{
return snd_dmaengine_pcm_close_release_chan(substream);
}
-EXPORT_SYMBOL(__pxa2xx_pcm_close);
+EXPORT_SYMBOL(pxa2xx_pcm_close);
int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma)
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index 445e691126e5..da252d1f732e 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -20,8 +20,8 @@
#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
-static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
+static int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_dmaengine_dai_dma_data *dma;
@@ -33,23 +33,16 @@ static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
if (!dma)
return 0;
- return __pxa2xx_pcm_hw_params(substream, params);
-}
-
-static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
-{
- __pxa2xx_pcm_hw_free(substream);
-
- return 0;
+ return pxa2xx_pcm_hw_params(substream, params);
}
static const struct snd_pcm_ops pxa2xx_pcm_ops = {
- .open = __pxa2xx_pcm_open,
- .close = __pxa2xx_pcm_close,
+ .open = pxa2xx_pcm_open,
+ .close = pxa2xx_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
- .hw_params = pxa2xx_pcm_hw_params,
+ .hw_params = __pxa2xx_pcm_hw_params,
.hw_free = pxa2xx_pcm_hw_free,
- .prepare = __pxa2xx_pcm_prepare,
+ .prepare = pxa2xx_pcm_prepare,
.trigger = pxa2xx_pcm_trigger,
.pointer = pxa2xx_pcm_pointer,
.mmap = pxa2xx_pcm_mmap,
--
2.17.1
next prev parent reply other threads:[~2018-06-27 19:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 19:33 [PATCH 0/7] ASoC: pxa: code refactoring Daniel Mack
2018-06-27 19:33 ` [PATCH 1/7] ASoC: fold pxa2xx-pcm into its only user, pxa2xx-ac97 Daniel Mack
2018-06-29 11:07 ` Applied "ASoC: fold pxa2xx-pcm into its only user, pxa2xx-ac97" to the asoc tree Mark Brown
2018-06-27 19:33 ` Daniel Mack [this message]
2018-06-29 11:07 ` Applied "ASoC: pxa: clean up function names in pxa2xx-lib" " Mark Brown
2018-06-27 19:33 ` [PATCH 3/7] ASoC: pxa: move some functions to pxa2xx-lib Daniel Mack
2018-06-29 11:07 ` Applied "ASoC: pxa: move some functions to pxa2xx-lib" to the asoc tree Mark Brown
2018-06-27 19:33 ` [PATCH 4/7] ASoC: pxa2xx-pcm-lib: fix indenting Daniel Mack
2018-06-29 11:07 ` Applied "ASoC: pxa2xx-pcm-lib: fix indenting" to the asoc tree Mark Brown
2018-06-27 19:33 ` [PATCH 5/7] ASoC: pxa: provide PCM ops for ssp, i2s and ac97 components Daniel Mack
2018-06-27 19:33 ` [PATCH 6/7] ASoC: pxa: remove bindings from pxa2xx-pcm Daniel Mack
2018-06-29 11:07 ` Applied "ASoC: pxa: remove bindings from pxa2xx-pcm" to the asoc tree Mark Brown
2018-06-27 19:33 ` [PATCH 7/7] ASoC: pxa: make SND_PXA2XX_SOC_I2S selectable Daniel Mack
2018-06-29 11:07 ` Applied "ASoC: pxa: make SND_PXA2XX_SOC_I2S selectable" to the asoc tree Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180627193359.26631-3-daniel@zonque.org \
--to=daniel@zonque.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=haojian.zhuang@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox