Skip to content

Commit

Permalink
ASoC: soc-component: remove snd_pcm_ops from component driver
Browse files Browse the repository at this point in the history
No driver is using snd_pcm_ops on component driver.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8736gb90by.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Oct 8, 2019
1 parent a49e460 commit e9067bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 89 deletions.
5 changes: 0 additions & 5 deletions include/sound/soc-component.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 */
Expand Down
77 changes: 0 additions & 77 deletions sound/soc/soc-component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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);
}
}
10 changes: 3 additions & 7 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e9067bb

Please sign in to comment.