From 08e837dd9e39bd3e25b1fa1a13f6ba44040e3f0d Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 26 Jul 2019 13:51:17 +0900 Subject: ASoC: soc-component: add snd_soc_component_probe() Current ALSA SoC is directly using component->driver->xxx, thus, it is deep nested, and makes code difficult to read, and is not good for encapsulation. This patch adds new snd_soc_component_probe() and use it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/8736it5rlt.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/soc-component.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sound/soc/soc-component.c') diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 0a9ca84d7ac6..b2bfc0375193 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -366,3 +366,11 @@ int snd_soc_component_is_suspended(struct snd_soc_component *component) { return component->suspended; } + +int snd_soc_component_probe(struct snd_soc_component *component) +{ + if (component->driver->probe) + return component->driver->probe(component); + + return 0; +} -- cgit v1.2.3