Commit 62be484f authored by Viorel Suman's avatar Viorel Suman Committed by Mark Brown

ASoC: fsl_audmix: cache pdev->dev pointer

There should be no trouble to understand dev = pdev->dev.
This can save some space to have more print info or save
some wrapped lines.
Signed-off-by: default avatarViorel Suman <viorel.suman@nxp.com>
Suggested-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a23e34c0
...@@ -456,6 +456,7 @@ MODULE_DEVICE_TABLE(of, fsl_audmix_ids); ...@@ -456,6 +456,7 @@ MODULE_DEVICE_TABLE(of, fsl_audmix_ids);
static int fsl_audmix_probe(struct platform_device *pdev) static int fsl_audmix_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct fsl_audmix *priv; struct fsl_audmix *priv;
struct resource *res; struct resource *res;
const char *mdrv; const char *mdrv;
...@@ -463,52 +464,50 @@ static int fsl_audmix_probe(struct platform_device *pdev) ...@@ -463,52 +464,50 @@ static int fsl_audmix_probe(struct platform_device *pdev)
void __iomem *regs; void __iomem *regs;
int ret; int ret;
of_id = of_match_device(fsl_audmix_ids, &pdev->dev); of_id = of_match_device(fsl_audmix_ids, dev);
if (!of_id || !of_id->data) if (!of_id || !of_id->data)
return -EINVAL; return -EINVAL;
mdrv = of_id->data; mdrv = of_id->data;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
/* Get the addresses */ /* Get the addresses */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(&pdev->dev, res); regs = devm_ioremap_resource(dev, res);
if (IS_ERR(regs)) if (IS_ERR(regs))
return PTR_ERR(regs); return PTR_ERR(regs);
priv->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "ipg", regs, priv->regmap = devm_regmap_init_mmio_clk(dev, "ipg", regs,
&fsl_audmix_regmap_config); &fsl_audmix_regmap_config);
if (IS_ERR(priv->regmap)) { if (IS_ERR(priv->regmap)) {
dev_err(&pdev->dev, "failed to init regmap\n"); dev_err(dev, "failed to init regmap\n");
return PTR_ERR(priv->regmap); return PTR_ERR(priv->regmap);
} }
priv->ipg_clk = devm_clk_get(&pdev->dev, "ipg"); priv->ipg_clk = devm_clk_get(dev, "ipg");
if (IS_ERR(priv->ipg_clk)) { if (IS_ERR(priv->ipg_clk)) {
dev_err(&pdev->dev, "failed to get ipg clock\n"); dev_err(dev, "failed to get ipg clock\n");
return PTR_ERR(priv->ipg_clk); return PTR_ERR(priv->ipg_clk);
} }
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(dev);
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_audmix_component, ret = devm_snd_soc_register_component(dev, &fsl_audmix_component,
fsl_audmix_dai, fsl_audmix_dai,
ARRAY_SIZE(fsl_audmix_dai)); ARRAY_SIZE(fsl_audmix_dai));
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to register ASoC DAI\n"); dev_err(dev, "failed to register ASoC DAI\n");
return ret; return ret;
} }
priv->pdev = platform_device_register_data(&pdev->dev, mdrv, 0, NULL, priv->pdev = platform_device_register_data(dev, mdrv, 0, NULL, 0);
0);
if (IS_ERR(priv->pdev)) { if (IS_ERR(priv->pdev)) {
ret = PTR_ERR(priv->pdev); ret = PTR_ERR(priv->pdev);
dev_err(&pdev->dev, "failed to register platform %s: %d\n", dev_err(dev, "failed to register platform %s: %d\n", mdrv, ret);
mdrv, ret);
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment