alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [alsa-devel] [PATCH 44/44] ASoC: soc-component: remove snd_pcm_ops from component driver
Date: 02 Oct 2019 14:35:13 +0900	[thread overview]
Message-ID: <8736gb90by.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87v9t7af54.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

No driver is using snd_pcm_ops on component driver.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc-component.h |  5 ---
 sound/soc/soc-component.c     | 77 -------------------------------------------
 sound/soc/soc-pcm.c           | 10 ++----
 3 files changed, 3 insertions(+), 89 deletions(-)

diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index aa2e2cbc..6aa3ecb 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -46,11 +46,7 @@ struct snd_soc_component_driver {
 	int (*write)(struct snd_soc_component *component,
 		     unsigned int reg, unsigned int val);
 
-	/* remove me */
 	/* pcm creation and destruction */
-	int (*pcm_new)(struct snd_soc_pcm_runtime *rtd);
-	void (*pcm_free)(struct snd_pcm *pcm);
-
 	int (*pcm_construct)(struct snd_soc_component *component,
 			     struct snd_soc_pcm_runtime *rtd);
 	void (*pcm_destruct)(struct snd_soc_component *component,
@@ -110,7 +106,6 @@ struct snd_soc_component_driver {
 		    struct snd_pcm_substream *substream,
 		    struct vm_area_struct *vma);
 
-	const struct snd_pcm_ops *ops;
 	const struct snd_compr_ops *compr_ops;
 
 	/* probe ordering - for components with runtime dependencies */
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index d2b052a..debaf1f 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -316,12 +316,6 @@ int snd_soc_component_open(struct snd_soc_component *component,
 {
 	if (component->driver->open)
 		return component->driver->open(component, substream);
-
-	/* remove me */
-	if (component->driver->ops &&
-	    component->driver->ops->open)
-		return component->driver->ops->open(substream);
-
 	return 0;
 }
 
@@ -330,12 +324,6 @@ int snd_soc_component_close(struct snd_soc_component *component,
 {
 	if (component->driver->close)
 		return component->driver->close(component, substream);
-
-	/* remove me */
-	if (component->driver->ops &&
-	    component->driver->ops->close)
-		return component->driver->ops->close(substream);
-
 	return 0;
 }
 
@@ -344,12 +332,6 @@ int snd_soc_component_prepare(struct snd_soc_component *component,
 {
 	if (component->driver->prepare)
 		return component->driver->prepare(component, substream);
-
-	/* remove me */
-	if (component->driver->ops &&
-	    component->driver->ops->prepare)
-		return component->driver->ops->prepare(substream);
-
 	return 0;
 }
 
@@ -360,12 +342,6 @@ int snd_soc_component_hw_params(struct snd_soc_component *component,
 	if (component->driver->hw_params)
 		return component->driver->hw_params(component,
 						    substream, params);
-
-	/* remove me */
-	if (component->driver->ops &&
-	    component->driver->ops->hw_params)
-		return component->driver->ops->hw_params(substream, params);
-
 	return 0;
 }
 
@@ -374,12 +350,6 @@ int snd_soc_component_hw_free(struct snd_soc_component *component,
 {
 	if (component->driver->hw_free)
 		return component->driver->hw_free(component, substream);
-
-	/* remove me */
-	if (component->driver->ops &&
-	    component->driver->ops->hw_free)
-		return component->driver->ops->hw_free(substream);
-
 	return 0;
 }
 
@@ -389,12 +359,6 @@ int snd_soc_component_trigger(struct snd_soc_component *component,
 {
 	if (component->driver->trigger)
 		return component->driver->trigger(component, substream, cmd);
-
-	/* remove me */
-	if (component->driver->ops &&
-	    component->driver->ops->trigger)
-		return component->driver->ops->trigger(substream, cmd);
-
 	return 0;
 }
 
@@ -462,11 +426,6 @@ int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream)
 		/* FIXME: use 1st pointer */
 		if (component->driver->pointer)
 			return component->driver->pointer(component, substream);
-
-		/* remove me */
-		if (component->driver->ops &&
-		    component->driver->ops->pointer)
-			return component->driver->ops->pointer(substream);
 	}
 
 	return 0;
@@ -486,12 +445,6 @@ int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
 		if (component->driver->ioctl)
 			return component->driver->ioctl(component, substream,
 							cmd, arg);
-
-		/* remove me */
-		if (component->driver->ops &&
-		    component->driver->ops->ioctl)
-			return component->driver->ops->ioctl(substream,
-							     cmd, arg);
 	}
 
 	return snd_pcm_lib_ioctl(substream, cmd, arg);
@@ -512,12 +465,6 @@ int snd_soc_pcm_component_copy_user(struct snd_pcm_substream *substream,
 		if (component->driver->copy_user)
 			return component->driver->copy_user(
 				component, substream, channel, pos, buf, bytes);
-
-		/* remove me */
-		if (component->driver->ops &&
-		    component->driver->ops->copy_user)
-			return component->driver->ops->copy_user(
-				substream, channel, pos, buf, bytes);
 	}
 
 	return -EINVAL;
@@ -541,14 +488,6 @@ struct page *snd_soc_pcm_component_page(struct snd_pcm_substream *substream,
 			if (page)
 				return page;
 		}
-
-		/* remove me */
-		if (component->driver->ops &&
-		    component->driver->ops->page) {
-			page = component->driver->ops->page(substream, offset);
-			if (page)
-				return page;
-		}
 	}
 
 	return NULL;
@@ -568,11 +507,6 @@ int snd_soc_pcm_component_mmap(struct snd_pcm_substream *substream,
 		if (component->driver->mmap)
 			return component->driver->mmap(component,
 						       substream, vma);
-
-		/* remove me */
-		if (component->driver->ops &&
-		    component->driver->ops->mmap)
-			return component->driver->ops->mmap(substream, vma);
 	}
 
 	return -EINVAL;
@@ -593,13 +527,6 @@ int snd_soc_pcm_component_new(struct snd_pcm *pcm)
 			if (ret < 0)
 				return ret;
 		}
-
-		/* remove me */
-		if (component->driver->pcm_new) {
-			ret = component->driver->pcm_new(rtd);
-			if (ret < 0)
-				return ret;
-		}
 	}
 
 	return 0;
@@ -616,9 +543,5 @@ void snd_soc_pcm_component_free(struct snd_pcm *pcm)
 
 		if (component->driver->pcm_destruct)
 			component->driver->pcm_destruct(component, pcm);
-
-		/* remove me */
-		if (component->driver->pcm_free)
-			component->driver->pcm_free(pcm);
 	}
 }
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index b1f11d3..484c17b 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2988,16 +2988,12 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 
 	for_each_rtdcom(rtd, rtdcom) {
 		const struct snd_soc_component_driver *drv = rtdcom->component->driver;
-		const struct snd_pcm_ops *ops = drv->ops;
 
-		if (!ops)
-			continue;
-
-		if (ops->copy_user || drv->copy_user)
+		if (drv->copy_user)
 			rtd->ops.copy_user	= snd_soc_pcm_component_copy_user;
-		if (ops->page || drv->page)
+		if (drv->page)
 			rtd->ops.page		= snd_soc_pcm_component_page;
-		if (ops->mmap || drv->mmap)
+		if (drv->mmap)
 			rtd->ops.mmap		= snd_soc_pcm_component_mmap;
 	}
 
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-10-02  6:03 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02  5:29 [alsa-devel] [PATCH 00/44] ASoC: don't use snd_pcm_ops Kuninori Morimoto
2019-10-02  5:30 ` [alsa-devel] [PATCH 01/44] ASoC: soc-core: merge snd_pcm_ops member to component driver Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-core: merge snd_pcm_ops member to component driver" to the asoc tree Mark Brown
2019-10-02  5:30 ` [alsa-devel] [PATCH 02/44] ASoC: soc-core: add new pcm_construct/pcm_destruct Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-core: add new pcm_construct/pcm_destruct" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 03/44] ASoC: soc-core: add snd_soc_pcm_lib_ioctl() Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-core: add snd_soc_pcm_lib_ioctl()" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 04/44] ASoC: intel: sst-haswell-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: sst-haswell-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 05/44] ASoC: intel: skl-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: skl-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 06/44] ASoC: intel: sst-mfld-platform-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: sst-mfld-platform-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 07/44] ASoC: intel: sst-baytrail-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: sst-baytrail-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 08/44] ASoC: amd: acp3x-pcm-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: amd: acp3x-pcm-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 09/44] ASoC: amd: acp-pcm-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: amd: acp-pcm-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 10/44] ASoC: atmel: atmel-pcm-pdc: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: atmel: atmel-pcm-pdc: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 11/44] ASoC: au1x: dbdma2: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: au1x: dbdma2: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 12/44] ASoC: au1x: dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: au1x: dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 13/44] ASoC: xtensa: xtfpga-i2s: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: xtensa: xtfpga-i2s: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 14/44] ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 14/44] ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-02  5:32 ` [alsa-devel] [PATCH 15/44] ASoC: uniphier: aio-dma: " Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: uniphier: aio-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 16/44] ASoC: txx9: txx9aclc: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: txx9: txx9aclc: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 17/44] ASoC: stm: stm32_adfsdm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: stm: stm32_adfsdm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 18/44] ASoC: sprd: sprd-pcm-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sprd: sprd-pcm-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 19/44] ASoC: sof: pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sof: pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 20/44] ASoC: sh: rsnd: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: rsnd: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 21/44] ASoC: sh: fsi: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: fsi: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 22/44] ASoC: sh: dma-sh7760: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: dma-sh7760: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 23/44] ASoC: sh: siu_pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: siu_pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 24/44] ASoC: samsung: idma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: samsung: idma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 25/44] ASoC: qcom: lpass-platform: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: qcom: lpass-platform: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 26/44] ASoC: qcom: q6routing: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: qcom: q6routing: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 27/44] ASoC: qcom: q6asm-dai: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: qcom: q6asm-dai: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 28/44] ASoC: pxa: mmp-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: pxa: mmp-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 29/44] ASoC: pxa: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: pxa: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 30/44] ASoC: meson: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: meson: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 31/44] ASoC: mediatek: mtk-btcvsd: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: mediatek: mtk-btcvsd: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 32/44] ASoC: mediatek: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: mediatek: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 33/44] ASoC: kirkwood: kirkwood-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: kirkwood: kirkwood-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 34/44] ASoC: dwc: dwc-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: dwc: dwc-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 35/44] ASoC: rt5514-spi: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: rt5514-spi: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 36/44] ASoC: bcm: cygnus-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: bcm: cygnus-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 37/44] ASoC: fsl: imx-pcm-fiq: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: imx-pcm-fiq: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 38/44] ASoC: fsl: fsl_dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: fsl_dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 39/44] ASoC: fsl: mpc5200_dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: mpc5200_dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 40/44] ASoC: fsl: fsl_asrc_dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: fsl_asrc_dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 41/44] ASoC: fsl: fsl_dma: don't use snd_soc_rtdcom_lookup() Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: fsl_dma: don't use snd_soc_rtdcom_lookup()" to the asoc tree Mark Brown
2019-10-02  5:35 ` [alsa-devel] [PATCH 42/44] ASoC: soc-generic-dmaengine-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-generic-dmaengine-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:35 ` [alsa-devel] [PATCH 43/44] ASoC: soc-utils: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-utils: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:35 ` Kuninori Morimoto [this message]
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-component: remove snd_pcm_ops from component driver" " 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=8736gb90by.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).