diff mbox

[LTSI-3.14,562/894] ASoC: rsnd: remove rsnd_src_non_ops

Message ID 1409209620-24487-563-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Horman Aug. 28, 2014, 7:01 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Renesas sound driver is supporting Gen1/Gen2.
SRC probe can return error if it was unknown
generation.
Now, rsnd_src_non_ops is not needed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 033e7ed85b8513db4efacbdf0f22db2bed4ff405)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 sound/soc/sh/rcar/src.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index df5d7f8..89d24ee 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -268,10 +268,6 @@  static int rsnd_src_stop(struct rsnd_mod *mod,
 	return 0;
 }
 
-static struct rsnd_mod_ops rsnd_src_non_ops = {
-	.name	= "src (non)",
-};
-
 /*
  *		Gen1 functions
  */
@@ -627,6 +623,16 @@  int rsnd_src_probe(struct platform_device *pdev,
 	char name[RSND_SRC_NAME_SIZE];
 	int i, nr;
 
+	ops = NULL;
+	if (rsnd_is_gen1(priv))
+		ops = &rsnd_src_gen1_ops;
+	if (rsnd_is_gen2(priv))
+		ops = &rsnd_src_gen2_ops;
+	if (!ops) {
+		dev_err(dev, "unknown Generation\n");
+		return -EIO;
+	}
+
 	rsnd_of_parse_src(pdev, of_data, priv);
 
 	/*
@@ -655,12 +661,6 @@  int rsnd_src_probe(struct platform_device *pdev,
 		src->info = &info->src_info[i];
 		src->clk = clk;
 
-		ops = &rsnd_src_non_ops;
-		if (rsnd_is_gen1(priv))
-			ops = &rsnd_src_gen1_ops;
-		if (rsnd_is_gen2(priv))
-			ops = &rsnd_src_gen2_ops;
-
 		rsnd_mod_init(priv, &src->mod, ops, RSND_MOD_SRC, i);
 
 		dev_dbg(dev, "SRC%d probed\n", i);