summaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/fsl_audmix.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c
index dc802d5c4ccd..3897a54a11fe 100644
--- a/sound/soc/fsl/fsl_audmix.c
+++ b/sound/soc/fsl/fsl_audmix.c
@@ -456,6 +456,7 @@ MODULE_DEVICE_TABLE(of, fsl_audmix_ids);
456 456
457static int fsl_audmix_probe(struct platform_device *pdev) 457static int fsl_audmix_probe(struct platform_device *pdev)
458{ 458{
459 struct device *dev = &pdev->dev;
459 struct fsl_audmix *priv; 460 struct fsl_audmix *priv;
460 struct resource *res; 461 struct resource *res;
461 const char *mdrv; 462 const char *mdrv;
@@ -463,52 +464,50 @@ static int fsl_audmix_probe(struct platform_device *pdev)
463 void __iomem *regs; 464 void __iomem *regs;
464 int ret; 465 int ret;
465 466
466 of_id = of_match_device(fsl_audmix_ids, &pdev->dev); 467 of_id = of_match_device(fsl_audmix_ids, dev);
467 if (!of_id || !of_id->data) 468 if (!of_id || !of_id->data)
468 return -EINVAL; 469 return -EINVAL;
469 470
470 mdrv = of_id->data; 471 mdrv = of_id->data;
471 472
472 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 473 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
473 if (!priv) 474 if (!priv)
474 return -ENOMEM; 475 return -ENOMEM;
475 476
476 /* Get the addresses */ 477 /* Get the addresses */
477 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 478 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
478 regs = devm_ioremap_resource(&pdev->dev, res); 479 regs = devm_ioremap_resource(dev, res);
479 if (IS_ERR(regs)) 480 if (IS_ERR(regs))
480 return PTR_ERR(regs); 481 return PTR_ERR(regs);
481 482
482 priv->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "ipg", regs, 483 priv->regmap = devm_regmap_init_mmio_clk(dev, "ipg", regs,
483 &fsl_audmix_regmap_config); 484 &fsl_audmix_regmap_config);
484 if (IS_ERR(priv->regmap)) { 485 if (IS_ERR(priv->regmap)) {
485 dev_err(&pdev->dev, "failed to init regmap\n"); 486 dev_err(dev, "failed to init regmap\n");
486 return PTR_ERR(priv->regmap); 487 return PTR_ERR(priv->regmap);
487 } 488 }
488 489
489 priv->ipg_clk = devm_clk_get(&pdev->dev, "ipg"); 490 priv->ipg_clk = devm_clk_get(dev, "ipg");
490 if (IS_ERR(priv->ipg_clk)) { 491 if (IS_ERR(priv->ipg_clk)) {
491 dev_err(&pdev->dev, "failed to get ipg clock\n"); 492 dev_err(dev, "failed to get ipg clock\n");
492 return PTR_ERR(priv->ipg_clk); 493 return PTR_ERR(priv->ipg_clk);
493 } 494 }
494 495
495 platform_set_drvdata(pdev, priv); 496 platform_set_drvdata(pdev, priv);
496 pm_runtime_enable(&pdev->dev); 497 pm_runtime_enable(dev);
497 498
498 ret = devm_snd_soc_register_component(&pdev->dev, &fsl_audmix_component, 499 ret = devm_snd_soc_register_component(dev, &fsl_audmix_component,
499 fsl_audmix_dai, 500 fsl_audmix_dai,
500 ARRAY_SIZE(fsl_audmix_dai)); 501 ARRAY_SIZE(fsl_audmix_dai));
501 if (ret) { 502 if (ret) {
502 dev_err(&pdev->dev, "failed to register ASoC DAI\n"); 503 dev_err(dev, "failed to register ASoC DAI\n");
503 return ret; 504 return ret;
504 } 505 }
505 506
506 priv->pdev = platform_device_register_data(&pdev->dev, mdrv, 0, NULL, 507 priv->pdev = platform_device_register_data(dev, mdrv, 0, NULL, 0);
507 0);
508 if (IS_ERR(priv->pdev)) { 508 if (IS_ERR(priv->pdev)) {
509 ret = PTR_ERR(priv->pdev); 509 ret = PTR_ERR(priv->pdev);
510 dev_err(&pdev->dev, "failed to register platform %s: %d\n", 510 dev_err(dev, "failed to register platform %s: %d\n", mdrv, ret);
511 mdrv, ret);
512 } 511 }
513 512
514 return ret; 513 return ret;