aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/sh/rcar/gen.c33
1 files changed, 6 insertions, 27 deletions
diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 4f2eaa3262d7..a29e36eb1a30 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -10,14 +10,6 @@
10 */ 10 */
11#include "rsnd.h" 11#include "rsnd.h"
12 12
13struct rsnd_gen_ops {
14 int (*probe)(struct platform_device *pdev,
15 struct rcar_snd_info *info,
16 struct rsnd_priv *priv);
17 void (*remove)(struct platform_device *pdev,
18 struct rsnd_priv *priv);
19};
20
21struct rsnd_gen { 13struct rsnd_gen {
22 void __iomem *base[RSND_BASE_MAX]; 14 void __iomem *base[RSND_BASE_MAX];
23 15
@@ -307,16 +299,6 @@ static int rsnd_gen1_probe(struct platform_device *pdev,
307 299
308} 300}
309 301
310static void rsnd_gen1_remove(struct platform_device *pdev,
311 struct rsnd_priv *priv)
312{
313}
314
315static struct rsnd_gen_ops rsnd_gen1_ops = {
316 .probe = rsnd_gen1_probe,
317 .remove = rsnd_gen1_remove,
318};
319
320/* 302/*
321 * Gen 303 * Gen
322 */ 304 */
@@ -326,6 +308,7 @@ int rsnd_gen_probe(struct platform_device *pdev,
326{ 308{
327 struct device *dev = rsnd_priv_to_dev(priv); 309 struct device *dev = rsnd_priv_to_dev(priv);
328 struct rsnd_gen *gen; 310 struct rsnd_gen *gen;
311 int ret;
329 312
330 gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL); 313 gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL);
331 if (!gen) { 314 if (!gen) {
@@ -333,23 +316,19 @@ int rsnd_gen_probe(struct platform_device *pdev,
333 return -ENOMEM; 316 return -ENOMEM;
334 } 317 }
335 318
336 if (rsnd_is_gen1(priv)) 319 priv->gen = gen;
337 gen->ops = &rsnd_gen1_ops;
338 320
339 if (!gen->ops) { 321 if (rsnd_is_gen1(priv)) {
322 ret = rsnd_gen1_probe(pdev, info, priv);
323 } else {
340 dev_err(dev, "unknown generation R-Car sound device\n"); 324 dev_err(dev, "unknown generation R-Car sound device\n");
341 return -ENODEV; 325 return -ENODEV;
342 } 326 }
343 327
344 priv->gen = gen; 328 return ret;
345
346 return gen->ops->probe(pdev, info, priv);
347} 329}
348 330
349void rsnd_gen_remove(struct platform_device *pdev, 331void rsnd_gen_remove(struct platform_device *pdev,
350 struct rsnd_priv *priv) 332 struct rsnd_priv *priv)
351{ 333{
352 struct rsnd_gen *gen = rsnd_priv_to_gen(priv);
353
354 gen->ops->remove(pdev, priv);
355} 334}