Commit 38fa8d3c authored by Mark Brown's avatar Mark Brown

ASoC: Use dev_err_probe() helper

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

This patch-set tries to use dev_err_probe() helper function
instead of manual dev_err() code.
I hope ASoC will be more clean code by this patch-set.
parents 98bf33ca 11a95c58
...@@ -144,9 +144,9 @@ static int snd_proto_probe(struct platform_device *pdev) ...@@ -144,9 +144,9 @@ static int snd_proto_probe(struct platform_device *pdev)
of_node_put(cpu_np); of_node_put(cpu_np);
ret = snd_soc_register_card(&snd_proto); ret = snd_soc_register_card(&snd_proto);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, dev_err_probe(&pdev->dev, ret,
"snd_soc_register_card() failed: %d\n", ret); "snd_soc_register_card() failed\n");
return ret; return ret;
} }
......
...@@ -371,35 +371,27 @@ static int tse850_probe(struct platform_device *pdev) ...@@ -371,35 +371,27 @@ static int tse850_probe(struct platform_device *pdev)
} }
tse850->add = devm_gpiod_get(dev, "axentia,add", GPIOD_OUT_HIGH); tse850->add = devm_gpiod_get(dev, "axentia,add", GPIOD_OUT_HIGH);
if (IS_ERR(tse850->add)) { if (IS_ERR(tse850->add))
if (PTR_ERR(tse850->add) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(tse850->add),
dev_err(dev, "failed to get 'add' gpio\n"); "failed to get 'add' gpio\n");
return PTR_ERR(tse850->add);
}
tse850->add_cache = 1; tse850->add_cache = 1;
tse850->loop1 = devm_gpiod_get(dev, "axentia,loop1", GPIOD_OUT_HIGH); tse850->loop1 = devm_gpiod_get(dev, "axentia,loop1", GPIOD_OUT_HIGH);
if (IS_ERR(tse850->loop1)) { if (IS_ERR(tse850->loop1))
if (PTR_ERR(tse850->loop1) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(tse850->loop1),
dev_err(dev, "failed to get 'loop1' gpio\n"); "failed to get 'loop1' gpio\n");
return PTR_ERR(tse850->loop1);
}
tse850->loop1_cache = 1; tse850->loop1_cache = 1;
tse850->loop2 = devm_gpiod_get(dev, "axentia,loop2", GPIOD_OUT_HIGH); tse850->loop2 = devm_gpiod_get(dev, "axentia,loop2", GPIOD_OUT_HIGH);
if (IS_ERR(tse850->loop2)) { if (IS_ERR(tse850->loop2))
if (PTR_ERR(tse850->loop2) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(tse850->loop2),
dev_err(dev, "failed to get 'loop2' gpio\n"); "failed to get 'loop2' gpio\n");
return PTR_ERR(tse850->loop2);
}
tse850->loop2_cache = 1; tse850->loop2_cache = 1;
tse850->ana = devm_regulator_get(dev, "axentia,ana"); tse850->ana = devm_regulator_get(dev, "axentia,ana");
if (IS_ERR(tse850->ana)) { if (IS_ERR(tse850->ana))
if (PTR_ERR(tse850->ana) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(tse850->ana),
dev_err(dev, "failed to get 'ana' regulator\n"); "failed to get 'ana' regulator\n");
return PTR_ERR(tse850->ana);
}
ret = regulator_enable(tse850->ana); ret = regulator_enable(tse850->ana);
if (ret < 0) { if (ret < 0) {
......
...@@ -374,20 +374,14 @@ static int ak4118_i2c_probe(struct i2c_client *i2c, ...@@ -374,20 +374,14 @@ static int ak4118_i2c_probe(struct i2c_client *i2c,
i2c_set_clientdata(i2c, ak4118); i2c_set_clientdata(i2c, ak4118);
ak4118->reset = devm_gpiod_get(&i2c->dev, "reset", GPIOD_OUT_HIGH); ak4118->reset = devm_gpiod_get(&i2c->dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ak4118->reset)) { if (IS_ERR(ak4118->reset))
ret = PTR_ERR(ak4118->reset); return dev_err_probe(&i2c->dev, PTR_ERR(ak4118->reset),
if (ret != -EPROBE_DEFER) "Failed to get reset\n");
dev_err(&i2c->dev, "Failed to get reset: %d\n", ret);
return ret;
}
ak4118->irq = devm_gpiod_get(&i2c->dev, "irq", GPIOD_IN); ak4118->irq = devm_gpiod_get(&i2c->dev, "irq", GPIOD_IN);
if (IS_ERR(ak4118->irq)) { if (IS_ERR(ak4118->irq))
ret = PTR_ERR(ak4118->irq); return dev_err_probe(&i2c->dev, PTR_ERR(ak4118->irq),
if (ret != -EPROBE_DEFER) "Failed to get IRQ\n");
dev_err(&i2c->dev, "Failed to get IRQ: %d\n", ret);
return ret;
}
ret = devm_request_threaded_irq(&i2c->dev, gpiod_to_irq(ak4118->irq), ret = devm_request_threaded_irq(&i2c->dev, gpiod_to_irq(ak4118->irq),
NULL, ak4118_irq_handler, NULL, ak4118_irq_handler,
......
...@@ -255,7 +255,6 @@ static int es7241_probe(struct platform_device *pdev) ...@@ -255,7 +255,6 @@ static int es7241_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct es7241_data *priv; struct es7241_data *priv;
int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -271,28 +270,19 @@ static int es7241_probe(struct platform_device *pdev) ...@@ -271,28 +270,19 @@ static int es7241_probe(struct platform_device *pdev)
es7241_parse_fmt(dev, priv); es7241_parse_fmt(dev, priv);
priv->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); priv->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(priv->reset)) { if (IS_ERR(priv->reset))
err = PTR_ERR(priv->reset); return dev_err_probe(dev, PTR_ERR(priv->reset),
if (err != -EPROBE_DEFER) "Failed to get 'reset' gpio");
dev_err(dev, "Failed to get 'reset' gpio: %d", err);
return err;
}
priv->m0 = devm_gpiod_get_optional(dev, "m0", GPIOD_OUT_LOW); priv->m0 = devm_gpiod_get_optional(dev, "m0", GPIOD_OUT_LOW);
if (IS_ERR(priv->m0)) { if (IS_ERR(priv->m0))
err = PTR_ERR(priv->m0); return dev_err_probe(dev, PTR_ERR(priv->m0),
if (err != -EPROBE_DEFER) "Failed to get 'm0' gpio");
dev_err(dev, "Failed to get 'm0' gpio: %d", err);
return err;
}
priv->m1 = devm_gpiod_get_optional(dev, "m1", GPIOD_OUT_LOW); priv->m1 = devm_gpiod_get_optional(dev, "m1", GPIOD_OUT_LOW);
if (IS_ERR(priv->m1)) { if (IS_ERR(priv->m1))
err = PTR_ERR(priv->m1); return dev_err_probe(dev, PTR_ERR(priv->m1),
if (err != -EPROBE_DEFER) "Failed to get 'm1' gpio");
dev_err(dev, "Failed to get 'm1' gpio: %d", err);
return err;
}
return devm_snd_soc_register_component(&pdev->dev, return devm_snd_soc_register_component(&pdev->dev,
&es7241_component_driver, &es7241_component_driver,
......
...@@ -140,7 +140,6 @@ static int max9759_probe(struct platform_device *pdev) ...@@ -140,7 +140,6 @@ static int max9759_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct max9759 *priv; struct max9759 *priv;
int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -149,29 +148,20 @@ static int max9759_probe(struct platform_device *pdev) ...@@ -149,29 +148,20 @@ static int max9759_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
priv->gpiod_shutdown = devm_gpiod_get(dev, "shutdown", GPIOD_OUT_HIGH); priv->gpiod_shutdown = devm_gpiod_get(dev, "shutdown", GPIOD_OUT_HIGH);
if (IS_ERR(priv->gpiod_shutdown)) { if (IS_ERR(priv->gpiod_shutdown))
err = PTR_ERR(priv->gpiod_shutdown); return dev_err_probe(dev, PTR_ERR(priv->gpiod_shutdown),
if (err != -EPROBE_DEFER) "Failed to get 'shutdown' gpio");
dev_err(dev, "Failed to get 'shutdown' gpio: %d", err);
return err;
}
priv->gpiod_mute = devm_gpiod_get(dev, "mute", GPIOD_OUT_HIGH); priv->gpiod_mute = devm_gpiod_get(dev, "mute", GPIOD_OUT_HIGH);
if (IS_ERR(priv->gpiod_mute)) { if (IS_ERR(priv->gpiod_mute))
err = PTR_ERR(priv->gpiod_mute); return dev_err_probe(dev, PTR_ERR(priv->gpiod_mute),
if (err != -EPROBE_DEFER) "Failed to get 'mute' gpio");
dev_err(dev, "Failed to get 'mute' gpio: %d", err);
return err;
}
priv->is_mute = true; priv->is_mute = true;
priv->gpiod_gain = devm_gpiod_get_array(dev, "gain", GPIOD_OUT_HIGH); priv->gpiod_gain = devm_gpiod_get_array(dev, "gain", GPIOD_OUT_HIGH);
if (IS_ERR(priv->gpiod_gain)) { if (IS_ERR(priv->gpiod_gain))
err = PTR_ERR(priv->gpiod_gain); return dev_err_probe(dev, PTR_ERR(priv->gpiod_gain),
if (err != -EPROBE_DEFER) "Failed to get 'gain' gpios");
dev_err(dev, "Failed to get 'gain' gpios: %d", err);
return err;
}
priv->gain = 0; priv->gain = 0;
if (priv->gpiod_gain->ndescs != 2) { if (priv->gpiod_gain->ndescs != 2) {
......
...@@ -606,12 +606,9 @@ static int max9860_probe(struct i2c_client *i2c) ...@@ -606,12 +606,9 @@ static int max9860_probe(struct i2c_client *i2c)
return -ENOMEM; return -ENOMEM;
max9860->dvddio = devm_regulator_get(dev, "DVDDIO"); max9860->dvddio = devm_regulator_get(dev, "DVDDIO");
if (IS_ERR(max9860->dvddio)) { if (IS_ERR(max9860->dvddio))
ret = PTR_ERR(max9860->dvddio); return dev_err_probe(dev, PTR_ERR(max9860->dvddio),
if (ret != -EPROBE_DEFER) "Failed to get DVDDIO supply\n");
dev_err(dev, "Failed to get DVDDIO supply: %d\n", ret);
return ret;
}
max9860->dvddio_nb.notifier_call = max9860_dvddio_event; max9860->dvddio_nb.notifier_call = max9860_dvddio_event;
...@@ -643,8 +640,7 @@ static int max9860_probe(struct i2c_client *i2c) ...@@ -643,8 +640,7 @@ static int max9860_probe(struct i2c_client *i2c)
if (IS_ERR(mclk)) { if (IS_ERR(mclk)) {
ret = PTR_ERR(mclk); ret = PTR_ERR(mclk);
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "Failed to get MCLK\n");
dev_err(dev, "Failed to get MCLK: %d\n", ret);
goto err_regulator; goto err_regulator;
} }
......
...@@ -751,21 +751,14 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap) ...@@ -751,21 +751,14 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
pcm3168a->gpio_rst = devm_gpiod_get_optional(dev, "reset", pcm3168a->gpio_rst = devm_gpiod_get_optional(dev, "reset",
GPIOD_OUT_LOW | GPIOD_OUT_LOW |
GPIOD_FLAGS_BIT_NONEXCLUSIVE); GPIOD_FLAGS_BIT_NONEXCLUSIVE);
if (IS_ERR(pcm3168a->gpio_rst)) { if (IS_ERR(pcm3168a->gpio_rst))
ret = PTR_ERR(pcm3168a->gpio_rst); return dev_err_probe(dev, PTR_ERR(pcm3168a->gpio_rst),
if (ret != -EPROBE_DEFER ) "failed to acquire RST gpio\n");
dev_err(dev, "failed to acquire RST gpio: %d\n", ret);
return ret;
}
pcm3168a->scki = devm_clk_get(dev, "scki"); pcm3168a->scki = devm_clk_get(dev, "scki");
if (IS_ERR(pcm3168a->scki)) { if (IS_ERR(pcm3168a->scki))
ret = PTR_ERR(pcm3168a->scki); return dev_err_probe(dev, PTR_ERR(pcm3168a->scki),
if (ret != -EPROBE_DEFER) "failed to acquire clock 'scki'\n");
dev_err(dev, "failed to acquire clock 'scki': %d\n", ret);
return ret;
}
ret = clk_prepare_enable(pcm3168a->scki); ret = clk_prepare_enable(pcm3168a->scki);
if (ret) { if (ret) {
...@@ -781,8 +774,7 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap) ...@@ -781,8 +774,7 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
ret = devm_regulator_bulk_get(dev, ret = devm_regulator_bulk_get(dev,
ARRAY_SIZE(pcm3168a->supplies), pcm3168a->supplies); ARRAY_SIZE(pcm3168a->supplies), pcm3168a->supplies);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "failed to request supplies\n");
dev_err(dev, "failed to request supplies: %d\n", ret);
goto err_clk; goto err_clk;
} }
......
...@@ -1612,9 +1612,8 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, ...@@ -1612,9 +1612,8 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
if (ret == -ENOENT) if (ret == -ENOENT)
ret = -EPROBE_DEFER; ret = -EPROBE_DEFER;
if (ret != -EPROBE_DEFER) dev_err_probe(&client->dev, ret, "Failed to get mclock\n");
dev_err(&client->dev, "Failed to get mclock: %d\n",
ret);
goto disable_regs; goto disable_regs;
} }
......
...@@ -69,7 +69,6 @@ static int simple_amp_probe(struct platform_device *pdev) ...@@ -69,7 +69,6 @@ static int simple_amp_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct simple_amp *priv; struct simple_amp *priv;
int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (priv == NULL) if (priv == NULL)
...@@ -78,12 +77,9 @@ static int simple_amp_probe(struct platform_device *pdev) ...@@ -78,12 +77,9 @@ static int simple_amp_probe(struct platform_device *pdev)
priv->gpiod_enable = devm_gpiod_get_optional(dev, "enable", priv->gpiod_enable = devm_gpiod_get_optional(dev, "enable",
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(priv->gpiod_enable)) { if (IS_ERR(priv->gpiod_enable))
err = PTR_ERR(priv->gpiod_enable); return dev_err_probe(dev, PTR_ERR(priv->gpiod_enable),
if (err != -EPROBE_DEFER) "Failed to get 'enable' gpio");
dev_err(dev, "Failed to get 'enable' gpio: %d", err);
return err;
}
return devm_snd_soc_register_component(dev, return devm_snd_soc_register_component(dev,
&simple_amp_component_driver, &simple_amp_component_driver,
......
...@@ -82,7 +82,6 @@ static int simple_mux_probe(struct platform_device *pdev) ...@@ -82,7 +82,6 @@ static int simple_mux_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct simple_mux *priv; struct simple_mux *priv;
int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -91,12 +90,9 @@ static int simple_mux_probe(struct platform_device *pdev) ...@@ -91,12 +90,9 @@ static int simple_mux_probe(struct platform_device *pdev)
dev_set_drvdata(dev, priv); dev_set_drvdata(dev, priv);
priv->gpiod_mux = devm_gpiod_get(dev, "mux", GPIOD_OUT_LOW); priv->gpiod_mux = devm_gpiod_get(dev, "mux", GPIOD_OUT_LOW);
if (IS_ERR(priv->gpiod_mux)) { if (IS_ERR(priv->gpiod_mux))
err = PTR_ERR(priv->gpiod_mux); return dev_err_probe(dev, PTR_ERR(priv->gpiod_mux),
if (err != -EPROBE_DEFER) "Failed to get 'mux' gpio");
dev_err(dev, "Failed to get 'mux' gpio: %d", err);
return err;
}
return devm_snd_soc_register_component(dev, &simple_mux_component_driver, NULL, 0); return devm_snd_soc_register_component(dev, &simple_mux_component_driver, NULL, 0);
} }
......
...@@ -57,7 +57,6 @@ static int ssm2305_probe(struct platform_device *pdev) ...@@ -57,7 +57,6 @@ static int ssm2305_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct ssm2305 *priv; struct ssm2305 *priv;
int err;
/* Allocate the private data */ /* Allocate the private data */
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
...@@ -69,13 +68,9 @@ static int ssm2305_probe(struct platform_device *pdev) ...@@ -69,13 +68,9 @@ static int ssm2305_probe(struct platform_device *pdev)
/* Get shutdown gpio */ /* Get shutdown gpio */
priv->gpiod_shutdown = devm_gpiod_get(dev, "shutdown", priv->gpiod_shutdown = devm_gpiod_get(dev, "shutdown",
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(priv->gpiod_shutdown)) { if (IS_ERR(priv->gpiod_shutdown))
err = PTR_ERR(priv->gpiod_shutdown); return dev_err_probe(dev, PTR_ERR(priv->gpiod_shutdown),
if (err != -EPROBE_DEFER) "Failed to get 'shutdown' gpio\n");
dev_err(dev, "Failed to get 'shutdown' gpio: %d\n",
err);
return err;
}
return devm_snd_soc_register_component(dev, &ssm2305_component_driver, return devm_snd_soc_register_component(dev, &ssm2305_component_driver,
NULL, 0); NULL, 0);
......
...@@ -1680,11 +1680,9 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, ...@@ -1680,11 +1680,9 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c,
aic31xx->gpio_reset = devm_gpiod_get_optional(aic31xx->dev, "reset", aic31xx->gpio_reset = devm_gpiod_get_optional(aic31xx->dev, "reset",
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(aic31xx->gpio_reset)) { if (IS_ERR(aic31xx->gpio_reset))
if (PTR_ERR(aic31xx->gpio_reset) != -EPROBE_DEFER) return dev_err_probe(aic31xx->dev, PTR_ERR(aic31xx->gpio_reset),
dev_err(aic31xx->dev, "not able to acquire gpio\n"); "not able to acquire gpio\n");
return PTR_ERR(aic31xx->gpio_reset);
}
for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++)
aic31xx->supplies[i].supply = aic31xx_supply_names[i]; aic31xx->supplies[i].supply = aic31xx_supply_names[i];
...@@ -1692,12 +1690,8 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, ...@@ -1692,12 +1690,8 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c,
ret = devm_regulator_bulk_get(aic31xx->dev, ret = devm_regulator_bulk_get(aic31xx->dev,
ARRAY_SIZE(aic31xx->supplies), ARRAY_SIZE(aic31xx->supplies),
aic31xx->supplies); aic31xx->supplies);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(aic31xx->dev, ret, "Failed to request supplies\n");
dev_err(aic31xx->dev,
"Failed to request supplies: %d\n", ret);
return ret;
}
aic31xx_configure_ocmv(aic31xx); aic31xx_configure_ocmv(aic31xx);
......
...@@ -853,8 +853,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ...@@ -853,8 +853,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, &priv->card); ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
goto asrc_fail; goto asrc_fail;
} }
......
...@@ -563,9 +563,8 @@ static int imx_card_parse_of(struct imx_card_data *data) ...@@ -563,9 +563,8 @@ static int imx_card_parse_of(struct imx_card_data *data)
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name); ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(card->dev, ret,
dev_err(card->dev, "%s: error getting cpu dai name: %d\n", "%s: error getting cpu dai name\n", link->name);
link->name, ret);
goto err; goto err;
} }
...@@ -573,9 +572,8 @@ static int imx_card_parse_of(struct imx_card_data *data) ...@@ -573,9 +572,8 @@ static int imx_card_parse_of(struct imx_card_data *data)
if (codec) { if (codec) {
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
if (ret < 0) { if (ret < 0) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "%s: codec dai not found\n",
dev_err(dev, "%s: codec dai not found: %d\n", link->name);
link->name, ret);
goto err; goto err;
} }
...@@ -814,11 +812,8 @@ static int imx_card_probe(struct platform_device *pdev) ...@@ -814,11 +812,8 @@ static int imx_card_probe(struct platform_device *pdev)
} }
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
return ret;
}
return 0; return 0;
} }
......
...@@ -173,9 +173,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) ...@@ -173,9 +173,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
ret);
goto fail; goto fail;
} }
......
...@@ -70,8 +70,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev) ...@@ -70,8 +70,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
goto end; goto end;
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret); dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
end: end:
of_node_put(spdif_np); of_node_put(spdif_np);
......
...@@ -593,10 +593,7 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev) ...@@ -593,10 +593,7 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
err: err:
asoc_simple_clean_reference(card); asoc_simple_clean_reference(card);
if (ret != -EPROBE_DEFER) return dev_err_probe(dev, ret, "parse error\n");
dev_err(dev, "parse error %d\n", ret);
return ret;
} }
EXPORT_SYMBOL_GPL(audio_graph_parse_of); EXPORT_SYMBOL_GPL(audio_graph_parse_of);
......
...@@ -1238,8 +1238,8 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev, ...@@ -1238,8 +1238,8 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
err: err:
devm_kfree(dev, li); devm_kfree(dev, li);
if ((ret < 0) && (ret != -EPROBE_DEFER)) if (ret < 0)
dev_err(dev, "parse error %d\n", ret); dev_err_probe(dev, ret, "parse error\n");
return ret; return ret;
} }
......
...@@ -642,8 +642,7 @@ static int asoc_simple_probe(struct platform_device *pdev) ...@@ -642,8 +642,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
ret = simple_parse_of(priv, li); ret = simple_parse_of(priv, li);
if (ret < 0) { if (ret < 0) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "parse error\n");
dev_err(dev, "parse error %d\n", ret);
goto err; goto err;
} }
......
...@@ -451,11 +451,9 @@ static int img_i2s_in_probe(struct platform_device *pdev) ...@@ -451,11 +451,9 @@ static int img_i2s_in_probe(struct platform_device *pdev)
i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20); i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20);
i2s->clk_sys = devm_clk_get(dev, "sys"); i2s->clk_sys = devm_clk_get(dev, "sys");
if (IS_ERR(i2s->clk_sys)) { if (IS_ERR(i2s->clk_sys))
if (PTR_ERR(i2s->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(i2s->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(i2s->clk_sys);
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (!pm_runtime_enabled(&pdev->dev)) {
......
...@@ -457,25 +457,19 @@ static int img_i2s_out_probe(struct platform_device *pdev) ...@@ -457,25 +457,19 @@ static int img_i2s_out_probe(struct platform_device *pdev)
i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20); i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20);
i2s->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst"); i2s->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst");
if (IS_ERR(i2s->rst)) { if (IS_ERR(i2s->rst))
if (PTR_ERR(i2s->rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->rst),
dev_err(&pdev->dev, "No top level reset found\n"); "No top level reset found\n");
return PTR_ERR(i2s->rst);
}
i2s->clk_sys = devm_clk_get(&pdev->dev, "sys"); i2s->clk_sys = devm_clk_get(&pdev->dev, "sys");
if (IS_ERR(i2s->clk_sys)) { if (IS_ERR(i2s->clk_sys))
if (PTR_ERR(i2s->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(i2s->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(i2s->clk_sys);
}
i2s->clk_ref = devm_clk_get(&pdev->dev, "ref"); i2s->clk_ref = devm_clk_get(&pdev->dev, "ref");
if (IS_ERR(i2s->clk_ref)) { if (IS_ERR(i2s->clk_ref))
if (PTR_ERR(i2s->clk_ref) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(i2s->clk_ref),
dev_err(dev, "Failed to acquire clock 'ref'\n"); "Failed to acquire clock 'ref'\n");
return PTR_ERR(i2s->clk_ref);
}
i2s->suspend_ch_ctl = devm_kcalloc(dev, i2s->suspend_ch_ctl = devm_kcalloc(dev,
i2s->max_i2s_chan, sizeof(*i2s->suspend_ch_ctl), GFP_KERNEL); i2s->max_i2s_chan, sizeof(*i2s->suspend_ch_ctl), GFP_KERNEL);
......
...@@ -229,25 +229,19 @@ static int img_prl_out_probe(struct platform_device *pdev) ...@@ -229,25 +229,19 @@ static int img_prl_out_probe(struct platform_device *pdev)
prl->base = base; prl->base = base;
prl->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst"); prl->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst");
if (IS_ERR(prl->rst)) { if (IS_ERR(prl->rst))
if (PTR_ERR(prl->rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(prl->rst),
dev_err(&pdev->dev, "No top level reset found\n"); "No top level reset found\n");
return PTR_ERR(prl->rst);
}
prl->clk_sys = devm_clk_get(&pdev->dev, "sys"); prl->clk_sys = devm_clk_get(&pdev->dev, "sys");
if (IS_ERR(prl->clk_sys)) { if (IS_ERR(prl->clk_sys))
if (PTR_ERR(prl->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(prl->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(prl->clk_sys);
}
prl->clk_ref = devm_clk_get(&pdev->dev, "ref"); prl->clk_ref = devm_clk_get(&pdev->dev, "ref");
if (IS_ERR(prl->clk_ref)) { if (IS_ERR(prl->clk_ref))
if (PTR_ERR(prl->clk_ref) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(prl->clk_ref),
dev_err(dev, "Failed to acquire clock 'ref'\n"); "Failed to acquire clock 'ref'\n");
return PTR_ERR(prl->clk_ref);
}
ret = clk_prepare_enable(prl->clk_sys); ret = clk_prepare_enable(prl->clk_sys);
if (ret) if (ret)
......
...@@ -739,11 +739,9 @@ static int img_spdif_in_probe(struct platform_device *pdev) ...@@ -739,11 +739,9 @@ static int img_spdif_in_probe(struct platform_device *pdev)
spdif->base = base; spdif->base = base;
spdif->clk_sys = devm_clk_get(dev, "sys"); spdif->clk_sys = devm_clk_get(dev, "sys");
if (IS_ERR(spdif->clk_sys)) { if (IS_ERR(spdif->clk_sys))
if (PTR_ERR(spdif->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(spdif->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(spdif->clk_sys);
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (!pm_runtime_enabled(&pdev->dev)) {
......
...@@ -342,25 +342,19 @@ static int img_spdif_out_probe(struct platform_device *pdev) ...@@ -342,25 +342,19 @@ static int img_spdif_out_probe(struct platform_device *pdev)
spdif->base = base; spdif->base = base;
spdif->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst"); spdif->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst");
if (IS_ERR(spdif->rst)) { if (IS_ERR(spdif->rst))
if (PTR_ERR(spdif->rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(spdif->rst),
dev_err(&pdev->dev, "No top level reset found\n"); "No top level reset found\n");
return PTR_ERR(spdif->rst);
}
spdif->clk_sys = devm_clk_get(&pdev->dev, "sys"); spdif->clk_sys = devm_clk_get(&pdev->dev, "sys");
if (IS_ERR(spdif->clk_sys)) { if (IS_ERR(spdif->clk_sys))
if (PTR_ERR(spdif->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(spdif->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(spdif->clk_sys);
}
spdif->clk_ref = devm_clk_get(&pdev->dev, "ref"); spdif->clk_ref = devm_clk_get(&pdev->dev, "ref");
if (IS_ERR(spdif->clk_ref)) { if (IS_ERR(spdif->clk_ref))
if (PTR_ERR(spdif->clk_ref) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(spdif->clk_ref),
dev_err(dev, "Failed to acquire clock 'ref'\n"); "Failed to acquire clock 'ref'\n");
return PTR_ERR(spdif->clk_ref);
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (!pm_runtime_enabled(&pdev->dev)) {
......
...@@ -161,12 +161,9 @@ static int pistachio_internal_dac_probe(struct platform_device *pdev) ...@@ -161,12 +161,9 @@ static int pistachio_internal_dac_probe(struct platform_device *pdev)
return PTR_ERR(dac->regmap); return PTR_ERR(dac->regmap);
dac->supply = devm_regulator_get(dev, "VDD"); dac->supply = devm_regulator_get(dev, "VDD");
if (IS_ERR(dac->supply)) { if (IS_ERR(dac->supply))
ret = PTR_ERR(dac->supply); return dev_err_probe(dev, PTR_ERR(dac->supply),
if (ret != -EPROBE_DEFER) "failed to acquire supply 'VDD-supply'\n");
dev_err(dev, "failed to acquire supply 'VDD-supply': %d\n", ret);
return ret;
}
ret = regulator_enable(dac->supply); ret = regulator_enable(dac->supply);
if (ret) { if (ret) {
......
...@@ -218,34 +218,23 @@ static int aiu_clk_get(struct device *dev) ...@@ -218,34 +218,23 @@ static int aiu_clk_get(struct device *dev)
int ret; int ret;
aiu->pclk = devm_clk_get(dev, "pclk"); aiu->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(aiu->pclk)) { if (IS_ERR(aiu->pclk))
if (PTR_ERR(aiu->pclk) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(aiu->pclk), "Can't get the aiu pclk\n");
dev_err(dev, "Can't get the aiu pclk\n");
return PTR_ERR(aiu->pclk);
}
aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk"); aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk");
if (IS_ERR(aiu->spdif_mclk)) { if (IS_ERR(aiu->spdif_mclk))
if (PTR_ERR(aiu->spdif_mclk) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(aiu->spdif_mclk),
dev_err(dev, "Can't get the aiu spdif master clock\n"); "Can't get the aiu spdif master clock\n");
return PTR_ERR(aiu->spdif_mclk);
}
ret = aiu_clk_bulk_get(dev, aiu_i2s_ids, ARRAY_SIZE(aiu_i2s_ids), ret = aiu_clk_bulk_get(dev, aiu_i2s_ids, ARRAY_SIZE(aiu_i2s_ids),
&aiu->i2s); &aiu->i2s);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(dev, ret, "Can't get the i2s clocks\n");
dev_err(dev, "Can't get the i2s clocks\n");
return ret;
}
ret = aiu_clk_bulk_get(dev, aiu_spdif_ids, ARRAY_SIZE(aiu_spdif_ids), ret = aiu_clk_bulk_get(dev, aiu_spdif_ids, ARRAY_SIZE(aiu_spdif_ids),
&aiu->spdif); &aiu->spdif);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(dev, ret, "Can't get the spdif clocks\n");
dev_err(dev, "Can't get the spdif clocks\n");
return ret;
}
ret = clk_prepare_enable(aiu->pclk); ret = clk_prepare_enable(aiu->pclk);
if (ret) { if (ret) {
...@@ -281,11 +270,8 @@ static int aiu_probe(struct platform_device *pdev) ...@@ -281,11 +270,8 @@ static int aiu_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, aiu); platform_set_drvdata(pdev, aiu);
ret = device_reset(dev); ret = device_reset(dev);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(dev, ret, "Failed to reset device\n");
dev_err(dev, "Failed to reset device\n");
return ret;
}
regs = devm_platform_ioremap_resource(pdev, 0); regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(regs)) if (IS_ERR(regs))
......
...@@ -351,20 +351,12 @@ int axg_fifo_probe(struct platform_device *pdev) ...@@ -351,20 +351,12 @@ int axg_fifo_probe(struct platform_device *pdev)
} }
fifo->pclk = devm_clk_get(dev, NULL); fifo->pclk = devm_clk_get(dev, NULL);
if (IS_ERR(fifo->pclk)) { if (IS_ERR(fifo->pclk))
if (PTR_ERR(fifo->pclk) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(fifo->pclk), "failed to get pclk\n");
dev_err(dev, "failed to get pclk: %ld\n",
PTR_ERR(fifo->pclk));
return PTR_ERR(fifo->pclk);
}
fifo->arb = devm_reset_control_get_exclusive(dev, NULL); fifo->arb = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(fifo->arb)) { if (IS_ERR(fifo->arb))
if (PTR_ERR(fifo->arb) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(fifo->arb), "failed to get arb reset\n");
dev_err(dev, "failed to get arb reset: %ld\n",
PTR_ERR(fifo->arb));
return PTR_ERR(fifo->arb);
}
fifo->irq = of_irq_get(dev->of_node, 0); fifo->irq = of_irq_get(dev->of_node, 0);
if (fifo->irq <= 0) { if (fifo->irq <= 0) {
......
...@@ -586,7 +586,6 @@ static int axg_pdm_probe(struct platform_device *pdev) ...@@ -586,7 +586,6 @@ static int axg_pdm_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct axg_pdm *priv; struct axg_pdm *priv;
void __iomem *regs; void __iomem *regs;
int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -611,28 +610,16 @@ static int axg_pdm_probe(struct platform_device *pdev) ...@@ -611,28 +610,16 @@ static int axg_pdm_probe(struct platform_device *pdev)
} }
priv->pclk = devm_clk_get(dev, "pclk"); priv->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(priv->pclk)) { if (IS_ERR(priv->pclk))
ret = PTR_ERR(priv->pclk); return dev_err_probe(dev, PTR_ERR(priv->pclk), "failed to get pclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get pclk: %d\n", ret);
return ret;
}
priv->dclk = devm_clk_get(dev, "dclk"); priv->dclk = devm_clk_get(dev, "dclk");
if (IS_ERR(priv->dclk)) { if (IS_ERR(priv->dclk))
ret = PTR_ERR(priv->dclk); return dev_err_probe(dev, PTR_ERR(priv->dclk), "failed to get dclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get dclk: %d\n", ret);
return ret;
}
priv->sysclk = devm_clk_get(dev, "sysclk"); priv->sysclk = devm_clk_get(dev, "sysclk");
if (IS_ERR(priv->sysclk)) { if (IS_ERR(priv->sysclk))
ret = PTR_ERR(priv->sysclk); return dev_err_probe(dev, PTR_ERR(priv->sysclk), "failed to get dclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get dclk: %d\n", ret);
return ret;
}
return devm_snd_soc_register_component(dev, &axg_pdm_component_drv, return devm_snd_soc_register_component(dev, &axg_pdm_component_drv,
&axg_pdm_dai_drv, 1); &axg_pdm_dai_drv, 1);
......
...@@ -454,7 +454,6 @@ static int axg_spdifin_probe(struct platform_device *pdev) ...@@ -454,7 +454,6 @@ static int axg_spdifin_probe(struct platform_device *pdev)
struct axg_spdifin *priv; struct axg_spdifin *priv;
struct snd_soc_dai_driver *dai_drv; struct snd_soc_dai_driver *dai_drv;
void __iomem *regs; void __iomem *regs;
int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -479,20 +478,12 @@ static int axg_spdifin_probe(struct platform_device *pdev) ...@@ -479,20 +478,12 @@ static int axg_spdifin_probe(struct platform_device *pdev)
} }
priv->pclk = devm_clk_get(dev, "pclk"); priv->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(priv->pclk)) { if (IS_ERR(priv->pclk))
ret = PTR_ERR(priv->pclk); return dev_err_probe(dev, PTR_ERR(priv->pclk), "failed to get pclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get pclk: %d\n", ret);
return ret;
}
priv->refclk = devm_clk_get(dev, "refclk"); priv->refclk = devm_clk_get(dev, "refclk");
if (IS_ERR(priv->refclk)) { if (IS_ERR(priv->refclk))
ret = PTR_ERR(priv->refclk); return dev_err_probe(dev, PTR_ERR(priv->refclk), "failed to get mclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get mclk: %d\n", ret);
return ret;
}
dai_drv = axg_spdifin_get_dai_drv(dev, priv); dai_drv = axg_spdifin_get_dai_drv(dev, priv);
if (IS_ERR(dai_drv)) { if (IS_ERR(dai_drv)) {
......
...@@ -403,7 +403,6 @@ static int axg_spdifout_probe(struct platform_device *pdev) ...@@ -403,7 +403,6 @@ static int axg_spdifout_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct axg_spdifout *priv; struct axg_spdifout *priv;
void __iomem *regs; void __iomem *regs;
int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -422,20 +421,12 @@ static int axg_spdifout_probe(struct platform_device *pdev) ...@@ -422,20 +421,12 @@ static int axg_spdifout_probe(struct platform_device *pdev)
} }
priv->pclk = devm_clk_get(dev, "pclk"); priv->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(priv->pclk)) { if (IS_ERR(priv->pclk))
ret = PTR_ERR(priv->pclk); return dev_err_probe(dev, PTR_ERR(priv->pclk), "failed to get pclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get pclk: %d\n", ret);
return ret;
}
priv->mclk = devm_clk_get(dev, "mclk"); priv->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(priv->mclk)) { if (IS_ERR(priv->mclk))
ret = PTR_ERR(priv->mclk); return dev_err_probe(dev, PTR_ERR(priv->mclk), "failed to get mclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get mclk: %d\n", ret);
return ret;
}
return devm_snd_soc_register_component(dev, &axg_spdifout_component_drv, return devm_snd_soc_register_component(dev, &axg_spdifout_component_drv,
axg_spdifout_dai_drv, ARRAY_SIZE(axg_spdifout_dai_drv)); axg_spdifout_dai_drv, ARRAY_SIZE(axg_spdifout_dai_drv));
......
...@@ -255,7 +255,6 @@ int axg_tdm_formatter_probe(struct platform_device *pdev) ...@@ -255,7 +255,6 @@ int axg_tdm_formatter_probe(struct platform_device *pdev)
const struct axg_tdm_formatter_driver *drv; const struct axg_tdm_formatter_driver *drv;
struct axg_tdm_formatter *formatter; struct axg_tdm_formatter *formatter;
void __iomem *regs; void __iomem *regs;
int ret;
drv = of_device_get_match_data(dev); drv = of_device_get_match_data(dev);
if (!drv) { if (!drv) {
...@@ -282,57 +281,34 @@ int axg_tdm_formatter_probe(struct platform_device *pdev) ...@@ -282,57 +281,34 @@ int axg_tdm_formatter_probe(struct platform_device *pdev)
/* Peripharal clock */ /* Peripharal clock */
formatter->pclk = devm_clk_get(dev, "pclk"); formatter->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(formatter->pclk)) { if (IS_ERR(formatter->pclk))
ret = PTR_ERR(formatter->pclk); return dev_err_probe(dev, PTR_ERR(formatter->pclk), "failed to get pclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get pclk: %d\n", ret);
return ret;
}
/* Formatter bit clock */ /* Formatter bit clock */
formatter->sclk = devm_clk_get(dev, "sclk"); formatter->sclk = devm_clk_get(dev, "sclk");
if (IS_ERR(formatter->sclk)) { if (IS_ERR(formatter->sclk))
ret = PTR_ERR(formatter->sclk); return dev_err_probe(dev, PTR_ERR(formatter->sclk), "failed to get sclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get sclk: %d\n", ret);
return ret;
}
/* Formatter sample clock */ /* Formatter sample clock */
formatter->lrclk = devm_clk_get(dev, "lrclk"); formatter->lrclk = devm_clk_get(dev, "lrclk");
if (IS_ERR(formatter->lrclk)) { if (IS_ERR(formatter->lrclk))
ret = PTR_ERR(formatter->lrclk); return dev_err_probe(dev, PTR_ERR(formatter->lrclk), "failed to get lrclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get lrclk: %d\n", ret);
return ret;
}
/* Formatter bit clock input multiplexer */ /* Formatter bit clock input multiplexer */
formatter->sclk_sel = devm_clk_get(dev, "sclk_sel"); formatter->sclk_sel = devm_clk_get(dev, "sclk_sel");
if (IS_ERR(formatter->sclk_sel)) { if (IS_ERR(formatter->sclk_sel))
ret = PTR_ERR(formatter->sclk_sel); return dev_err_probe(dev, PTR_ERR(formatter->sclk_sel), "failed to get sclk_sel\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get sclk_sel: %d\n", ret);
return ret;
}
/* Formatter sample clock input multiplexer */ /* Formatter sample clock input multiplexer */
formatter->lrclk_sel = devm_clk_get(dev, "lrclk_sel"); formatter->lrclk_sel = devm_clk_get(dev, "lrclk_sel");
if (IS_ERR(formatter->lrclk_sel)) { if (IS_ERR(formatter->lrclk_sel))
ret = PTR_ERR(formatter->lrclk_sel); return dev_err_probe(dev, PTR_ERR(formatter->lrclk_sel),
if (ret != -EPROBE_DEFER) "failed to get lrclk_sel\n");
dev_err(dev, "failed to get lrclk_sel: %d\n", ret);
return ret;
}
/* Formatter dedicated reset line */ /* Formatter dedicated reset line */
formatter->reset = devm_reset_control_get_optional_exclusive(dev, NULL); formatter->reset = devm_reset_control_get_optional_exclusive(dev, NULL);
if (IS_ERR(formatter->reset)) { if (IS_ERR(formatter->reset))
ret = PTR_ERR(formatter->reset); return dev_err_probe(dev, PTR_ERR(formatter->reset), "failed to get reset\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get reset: %d\n", ret);
return ret;
}
return devm_snd_soc_register_component(dev, drv->component_drv, return devm_snd_soc_register_component(dev, drv->component_drv,
NULL, 0); NULL, 0);
......
...@@ -533,21 +533,13 @@ static int axg_tdm_iface_probe(struct platform_device *pdev) ...@@ -533,21 +533,13 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
/* Bit clock provided on the pad */ /* Bit clock provided on the pad */
iface->sclk = devm_clk_get(dev, "sclk"); iface->sclk = devm_clk_get(dev, "sclk");
if (IS_ERR(iface->sclk)) { if (IS_ERR(iface->sclk))
ret = PTR_ERR(iface->sclk); return dev_err_probe(dev, PTR_ERR(iface->sclk), "failed to get sclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get sclk: %d\n", ret);
return ret;
}
/* Sample clock provided on the pad */ /* Sample clock provided on the pad */
iface->lrclk = devm_clk_get(dev, "lrclk"); iface->lrclk = devm_clk_get(dev, "lrclk");
if (IS_ERR(iface->lrclk)) { if (IS_ERR(iface->lrclk))
ret = PTR_ERR(iface->lrclk); return dev_err_probe(dev, PTR_ERR(iface->lrclk), "failed to get lrclk\n");
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to get lrclk: %d\n", ret);
return ret;
}
/* /*
* mclk maybe be missing when the cpu dai is in slave mode and * mclk maybe be missing when the cpu dai is in slave mode and
...@@ -558,13 +550,10 @@ static int axg_tdm_iface_probe(struct platform_device *pdev) ...@@ -558,13 +550,10 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
iface->mclk = devm_clk_get(dev, "mclk"); iface->mclk = devm_clk_get(dev, "mclk");
if (IS_ERR(iface->mclk)) { if (IS_ERR(iface->mclk)) {
ret = PTR_ERR(iface->mclk); ret = PTR_ERR(iface->mclk);
if (ret == -ENOENT) { if (ret == -ENOENT)
iface->mclk = NULL; iface->mclk = NULL;
} else { else
if (ret != -EPROBE_DEFER) return dev_err_probe(dev, ret, "failed to get mclk\n");
dev_err(dev, "failed to get mclk: %d\n", ret);
return ret;
}
} }
return devm_snd_soc_register_component(dev, return devm_snd_soc_register_component(dev,
......
...@@ -85,11 +85,9 @@ int meson_card_parse_dai(struct snd_soc_card *card, ...@@ -85,11 +85,9 @@ int meson_card_parse_dai(struct snd_soc_card *card,
ret = of_parse_phandle_with_args(node, "sound-dai", ret = of_parse_phandle_with_args(node, "sound-dai",
"#sound-dai-cells", 0, &args); "#sound-dai-cells", 0, &args);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(card->dev, ret, "can't parse dai\n");
dev_err(card->dev, "can't parse dai %d\n", ret);
return ret;
}
*dai_of_node = args.np; *dai_of_node = args.np;
return snd_soc_get_dai_name(&args, dai_name); return snd_soc_get_dai_name(&args, dai_name);
......
...@@ -258,18 +258,12 @@ static int t9015_probe(struct platform_device *pdev) ...@@ -258,18 +258,12 @@ static int t9015_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
priv->pclk = devm_clk_get(dev, "pclk"); priv->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(priv->pclk)) { if (IS_ERR(priv->pclk))
if (PTR_ERR(priv->pclk) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(priv->pclk), "failed to get core clock\n");
dev_err(dev, "failed to get core clock\n");
return PTR_ERR(priv->pclk);
}
priv->avdd = devm_regulator_get(dev, "AVDD"); priv->avdd = devm_regulator_get(dev, "AVDD");
if (IS_ERR(priv->avdd)) { if (IS_ERR(priv->avdd))
if (PTR_ERR(priv->avdd) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(priv->avdd), "failed to AVDD\n");
dev_err(dev, "failed to AVDD\n");
return PTR_ERR(priv->avdd);
}
ret = clk_prepare_enable(priv->pclk); ret = clk_prepare_enable(priv->pclk);
if (ret) { if (ret) {
......
...@@ -160,12 +160,8 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev) ...@@ -160,12 +160,8 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
} }
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
ret);
return ret;
}
return 0; return 0;
} }
......
...@@ -94,9 +94,8 @@ int qcom_snd_parse_of(struct snd_soc_card *card) ...@@ -94,9 +94,8 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name); ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(card->dev, ret,
dev_err(card->dev, "%s: error getting cpu dai name: %d\n", "%s: error getting cpu dai name\n", link->name);
link->name, ret);
goto err; goto err;
} }
...@@ -116,9 +115,8 @@ int qcom_snd_parse_of(struct snd_soc_card *card) ...@@ -116,9 +115,8 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
if (codec) { if (codec) {
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
if (ret < 0) { if (ret < 0) {
if (ret != -EPROBE_DEFER) dev_err_probe(card->dev, ret,
dev_err(card->dev, "%s: codec dai not found: %d\n", "%s: codec dai not found\n", link->name);
link->name, ret);
goto err; goto err;
} }
......
...@@ -249,13 +249,9 @@ static int snd_rk_mc_probe(struct platform_device *pdev) ...@@ -249,13 +249,9 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, machine); snd_soc_card_set_drvdata(card, machine);
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret == -EPROBE_DEFER) if (ret)
return -EPROBE_DEFER; return dev_err_probe(&pdev->dev, ret,
if (ret) { "Soc register card failed\n");
dev_err(&pdev->dev,
"Soc register card failed %d\n", ret);
return ret;
}
return ret; return ret;
} }
......
...@@ -585,19 +585,16 @@ static int aries_audio_probe(struct platform_device *pdev) ...@@ -585,19 +585,16 @@ static int aries_audio_probe(struct platform_device *pdev)
extcon_np = of_parse_phandle(np, "extcon", 0); extcon_np = of_parse_phandle(np, "extcon", 0);
priv->usb_extcon = extcon_find_edev_by_node(extcon_np); priv->usb_extcon = extcon_find_edev_by_node(extcon_np);
if (IS_ERR(priv->usb_extcon)) { if (IS_ERR(priv->usb_extcon))
if (PTR_ERR(priv->usb_extcon) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(priv->usb_extcon),
dev_err(dev, "Failed to get extcon device"); "Failed to get extcon device");
return PTR_ERR(priv->usb_extcon);
}
of_node_put(extcon_np); of_node_put(extcon_np);
priv->adc = devm_iio_channel_get(dev, "headset-detect"); priv->adc = devm_iio_channel_get(dev, "headset-detect");
if (IS_ERR(priv->adc)) { if (IS_ERR(priv->adc))
if (PTR_ERR(priv->adc) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(priv->adc),
dev_err(dev, "Failed to get ADC channel"); "Failed to get ADC channel");
return PTR_ERR(priv->adc);
}
if (priv->adc->channel->type != IIO_VOLTAGE) if (priv->adc->channel->type != IIO_VOLTAGE)
return -EINVAL; return -EINVAL;
......
...@@ -174,9 +174,8 @@ static int arndale_audio_probe(struct platform_device *pdev) ...@@ -174,9 +174,8 @@ static int arndale_audio_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(card->dev, card); ret = devm_snd_soc_register_card(card->dev, card);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(&pdev->dev, ret,
dev_err(&pdev->dev, "snd_soc_register_card() failed\n");
"snd_soc_register_card() failed: %d\n", ret);
goto err_put_of_nodes; goto err_put_of_nodes;
} }
return 0; return 0;
......
...@@ -325,9 +325,8 @@ static int littlemill_probe(struct platform_device *pdev) ...@@ -325,9 +325,8 @@ static int littlemill_probe(struct platform_device *pdev)
card->dev = &pdev->dev; card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
ret);
return ret; return ret;
} }
......
...@@ -183,9 +183,8 @@ static int lowland_probe(struct platform_device *pdev) ...@@ -183,9 +183,8 @@ static int lowland_probe(struct platform_device *pdev)
card->dev = &pdev->dev; card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
ret);
return ret; return ret;
} }
......
...@@ -311,9 +311,7 @@ static int odroid_audio_probe(struct platform_device *pdev) ...@@ -311,9 +311,7 @@ static int odroid_audio_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(dev, card); ret = devm_snd_soc_register_card(dev, card);
if (ret < 0) { if (ret < 0) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "snd_soc_register_card() failed\n");
dev_err(dev, "snd_soc_register_card() failed: %d\n",
ret);
goto err_put_clk_i2s; goto err_put_clk_i2s;
} }
......
...@@ -179,8 +179,8 @@ static int smdk_audio_probe(struct platform_device *pdev) ...@@ -179,8 +179,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed:%d\n", ret); dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
return ret; return ret;
} }
......
...@@ -118,8 +118,8 @@ static int snd_smdk_probe(struct platform_device *pdev) ...@@ -118,8 +118,8 @@ static int snd_smdk_probe(struct platform_device *pdev)
smdk_pcm.dev = &pdev->dev; smdk_pcm.dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, &smdk_pcm); ret = devm_snd_soc_register_card(&pdev->dev, &smdk_pcm);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret); dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
return ret; return ret;
} }
......
...@@ -212,12 +212,9 @@ static int snow_probe(struct platform_device *pdev) ...@@ -212,12 +212,9 @@ static int snow_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, priv); snd_soc_card_set_drvdata(card, priv);
ret = devm_snd_soc_register_card(dev, card); ret = devm_snd_soc_register_card(dev, card);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, ret,
dev_err(&pdev->dev, "snd_soc_register_card failed\n");
"snd_soc_register_card failed (%d)\n", ret);
return ret;
}
return ret; return ret;
} }
......
...@@ -330,9 +330,8 @@ static int speyside_probe(struct platform_device *pdev) ...@@ -330,9 +330,8 @@ static int speyside_probe(struct platform_device *pdev)
card->dev = &pdev->dev; card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
ret);
return ret; return ret;
} }
......
...@@ -612,8 +612,7 @@ static int tm2_probe(struct platform_device *pdev) ...@@ -612,8 +612,7 @@ static int tm2_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(dev, card); ret = devm_snd_soc_register_card(dev, card);
if (ret < 0) { if (ret < 0) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "Failed to register card\n");
dev_err(dev, "Failed to register card: %d\n", ret);
goto dai_node_put; goto dai_node_put;
} }
......
...@@ -229,9 +229,8 @@ static int tobermory_probe(struct platform_device *pdev) ...@@ -229,9 +229,8 @@ static int tobermory_probe(struct platform_device *pdev)
card->dev = &pdev->dev; card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
ret);
return ret; return ret;
} }
......
...@@ -1045,36 +1045,24 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev, ...@@ -1045,36 +1045,24 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
/* Get clocks */ /* Get clocks */
i2s->pclk = devm_clk_get(&pdev->dev, "pclk"); i2s->pclk = devm_clk_get(&pdev->dev, "pclk");
if (IS_ERR(i2s->pclk)) { if (IS_ERR(i2s->pclk))
if (PTR_ERR(i2s->pclk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->pclk),
dev_err(&pdev->dev, "Could not get pclk: %ld\n", "Could not get pclk\n");
PTR_ERR(i2s->pclk));
return PTR_ERR(i2s->pclk);
}
i2s->i2sclk = devm_clk_get(&pdev->dev, "i2sclk"); i2s->i2sclk = devm_clk_get(&pdev->dev, "i2sclk");
if (IS_ERR(i2s->i2sclk)) { if (IS_ERR(i2s->i2sclk))
if (PTR_ERR(i2s->i2sclk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->i2sclk),
dev_err(&pdev->dev, "Could not get i2sclk: %ld\n", "Could not get i2sclk\n");
PTR_ERR(i2s->i2sclk));
return PTR_ERR(i2s->i2sclk);
}
i2s->x8kclk = devm_clk_get(&pdev->dev, "x8k"); i2s->x8kclk = devm_clk_get(&pdev->dev, "x8k");
if (IS_ERR(i2s->x8kclk)) { if (IS_ERR(i2s->x8kclk))
if (PTR_ERR(i2s->x8kclk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->x8kclk),
dev_err(&pdev->dev, "Could not get x8k parent clock: %ld\n", "Could not get x8k parent clock\n");
PTR_ERR(i2s->x8kclk));
return PTR_ERR(i2s->x8kclk);
}
i2s->x11kclk = devm_clk_get(&pdev->dev, "x11k"); i2s->x11kclk = devm_clk_get(&pdev->dev, "x11k");
if (IS_ERR(i2s->x11kclk)) { if (IS_ERR(i2s->x11kclk))
if (PTR_ERR(i2s->x11kclk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->x11kclk),
dev_err(&pdev->dev, "Could not get x11k parent clock: %ld\n", "Could not get x11k parent clock\n");
PTR_ERR(i2s->x11kclk));
return PTR_ERR(i2s->x11kclk);
}
/* Register mclk provider if requested */ /* Register mclk provider if requested */
if (of_find_property(np, "#clock-cells", NULL)) { if (of_find_property(np, "#clock-cells", NULL)) {
...@@ -1097,12 +1085,10 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev, ...@@ -1097,12 +1085,10 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
/* Reset */ /* Reset */
rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
if (IS_ERR(rst)) { if (IS_ERR(rst))
if (PTR_ERR(rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(rst),
dev_err(&pdev->dev, "Reset controller error %ld\n", "Reset controller error\n");
PTR_ERR(rst));
return PTR_ERR(rst);
}
reset_control_assert(rst); reset_control_assert(rst);
udelay(2); udelay(2);
reset_control_deassert(rst); reset_control_deassert(rst);
...@@ -1145,21 +1131,15 @@ static int stm32_i2s_probe(struct platform_device *pdev) ...@@ -1145,21 +1131,15 @@ static int stm32_i2s_probe(struct platform_device *pdev)
i2s->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "pclk", i2s->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "pclk",
i2s->base, i2s->regmap_conf); i2s->base, i2s->regmap_conf);
if (IS_ERR(i2s->regmap)) { if (IS_ERR(i2s->regmap))
if (PTR_ERR(i2s->regmap) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->regmap),
dev_err(&pdev->dev, "Regmap init error %ld\n", "Regmap init error\n");
PTR_ERR(i2s->regmap));
return PTR_ERR(i2s->regmap);
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0); ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, ret, "PCM DMA register error\n");
dev_err(&pdev->dev, "PCM DMA register error %d\n", ret);
return ret;
}
ret = snd_soc_register_component(&pdev->dev, &stm32_i2s_component, ret = snd_soc_register_component(&pdev->dev, &stm32_i2s_component,
i2s->dai_drv, 1); i2s->dai_drv, 1);
......
...@@ -173,29 +173,20 @@ static int stm32_sai_probe(struct platform_device *pdev) ...@@ -173,29 +173,20 @@ static int stm32_sai_probe(struct platform_device *pdev)
if (!STM_SAI_IS_F4(sai)) { if (!STM_SAI_IS_F4(sai)) {
sai->pclk = devm_clk_get(&pdev->dev, "pclk"); sai->pclk = devm_clk_get(&pdev->dev, "pclk");
if (IS_ERR(sai->pclk)) { if (IS_ERR(sai->pclk))
if (PTR_ERR(sai->pclk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(sai->pclk),
dev_err(&pdev->dev, "missing bus clock pclk: %ld\n", "missing bus clock pclk\n");
PTR_ERR(sai->pclk));
return PTR_ERR(sai->pclk);
}
} }
sai->clk_x8k = devm_clk_get(&pdev->dev, "x8k"); sai->clk_x8k = devm_clk_get(&pdev->dev, "x8k");
if (IS_ERR(sai->clk_x8k)) { if (IS_ERR(sai->clk_x8k))
if (PTR_ERR(sai->clk_x8k) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(sai->clk_x8k),
dev_err(&pdev->dev, "missing x8k parent clock: %ld\n", "missing x8k parent clock\n");
PTR_ERR(sai->clk_x8k));
return PTR_ERR(sai->clk_x8k);
}
sai->clk_x11k = devm_clk_get(&pdev->dev, "x11k"); sai->clk_x11k = devm_clk_get(&pdev->dev, "x11k");
if (IS_ERR(sai->clk_x11k)) { if (IS_ERR(sai->clk_x11k))
if (PTR_ERR(sai->clk_x11k) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(sai->clk_x11k),
dev_err(&pdev->dev, "missing x11k parent clock: %ld\n", "missing x11k parent clock\n");
PTR_ERR(sai->clk_x11k));
return PTR_ERR(sai->clk_x11k);
}
/* init irqs */ /* init irqs */
sai->irq = platform_get_irq(pdev, 0); sai->irq = platform_get_irq(pdev, 0);
...@@ -204,12 +195,10 @@ static int stm32_sai_probe(struct platform_device *pdev) ...@@ -204,12 +195,10 @@ static int stm32_sai_probe(struct platform_device *pdev)
/* reset */ /* reset */
rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
if (IS_ERR(rst)) { if (IS_ERR(rst))
if (PTR_ERR(rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(rst),
dev_err(&pdev->dev, "Reset controller error %ld\n", "Reset controller error\n");
PTR_ERR(rst));
return PTR_ERR(rst);
}
reset_control_assert(rst); reset_control_assert(rst);
udelay(2); udelay(2);
reset_control_deassert(rst); reset_control_deassert(rst);
......
...@@ -1379,12 +1379,9 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, ...@@ -1379,12 +1379,9 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
*/ */
sai->regmap = devm_regmap_init_mmio(&pdev->dev, base, sai->regmap = devm_regmap_init_mmio(&pdev->dev, base,
sai->regmap_config); sai->regmap_config);
if (IS_ERR(sai->regmap)) { if (IS_ERR(sai->regmap))
if (PTR_ERR(sai->regmap) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(sai->regmap),
dev_err(&pdev->dev, "Regmap init error %ld\n", "Regmap init error\n");
PTR_ERR(sai->regmap));
return PTR_ERR(sai->regmap);
}
/* Get direction property */ /* Get direction property */
if (of_property_match_string(np, "dma-names", "tx") >= 0) { if (of_property_match_string(np, "dma-names", "tx") >= 0) {
...@@ -1472,12 +1469,9 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, ...@@ -1472,12 +1469,9 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
of_node_put(args.np); of_node_put(args.np);
sai->sai_ck = devm_clk_get(&pdev->dev, "sai_ck"); sai->sai_ck = devm_clk_get(&pdev->dev, "sai_ck");
if (IS_ERR(sai->sai_ck)) { if (IS_ERR(sai->sai_ck))
if (PTR_ERR(sai->sai_ck) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(sai->sai_ck),
dev_err(&pdev->dev, "Missing kernel clock sai_ck: %ld\n", "Missing kernel clock sai_ck\n");
PTR_ERR(sai->sai_ck));
return PTR_ERR(sai->sai_ck);
}
ret = clk_prepare(sai->pdata->pclk); ret = clk_prepare(sai->pdata->pclk);
if (ret < 0) if (ret < 0)
...@@ -1551,11 +1545,8 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) ...@@ -1551,11 +1545,8 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
conf = &stm32_sai_pcm_config_spdif; conf = &stm32_sai_pcm_config_spdif;
ret = snd_dmaengine_pcm_register(&pdev->dev, conf, 0); ret = snd_dmaengine_pcm_register(&pdev->dev, conf, 0);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, ret, "Could not register pcm dma\n");
dev_err(&pdev->dev, "Could not register pcm dma\n");
return ret;
}
ret = snd_soc_register_component(&pdev->dev, &stm32_component, ret = snd_soc_register_component(&pdev->dev, &stm32_component,
&sai->cpu_dai_drv, 1); &sai->cpu_dai_drv, 1);
......
...@@ -406,12 +406,9 @@ static int stm32_spdifrx_dma_ctrl_register(struct device *dev, ...@@ -406,12 +406,9 @@ static int stm32_spdifrx_dma_ctrl_register(struct device *dev,
int ret; int ret;
spdifrx->ctrl_chan = dma_request_chan(dev, "rx-ctrl"); spdifrx->ctrl_chan = dma_request_chan(dev, "rx-ctrl");
if (IS_ERR(spdifrx->ctrl_chan)) { if (IS_ERR(spdifrx->ctrl_chan))
if (PTR_ERR(spdifrx->ctrl_chan) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(spdifrx->ctrl_chan),
dev_err(dev, "dma_request_slave_channel error %ld\n", "dma_request_slave_channel error\n");
PTR_ERR(spdifrx->ctrl_chan));
return PTR_ERR(spdifrx->ctrl_chan);
}
spdifrx->dmab = devm_kzalloc(dev, sizeof(struct snd_dma_buffer), spdifrx->dmab = devm_kzalloc(dev, sizeof(struct snd_dma_buffer),
GFP_KERNEL); GFP_KERNEL);
...@@ -930,12 +927,9 @@ static int stm32_spdifrx_parse_of(struct platform_device *pdev, ...@@ -930,12 +927,9 @@ static int stm32_spdifrx_parse_of(struct platform_device *pdev,
spdifrx->phys_addr = res->start; spdifrx->phys_addr = res->start;
spdifrx->kclk = devm_clk_get(&pdev->dev, "kclk"); spdifrx->kclk = devm_clk_get(&pdev->dev, "kclk");
if (IS_ERR(spdifrx->kclk)) { if (IS_ERR(spdifrx->kclk))
if (PTR_ERR(spdifrx->kclk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(spdifrx->kclk),
dev_err(&pdev->dev, "Could not get kclk: %ld\n", "Could not get kclk\n");
PTR_ERR(spdifrx->kclk));
return PTR_ERR(spdifrx->kclk);
}
spdifrx->irq = platform_get_irq(pdev, 0); spdifrx->irq = platform_get_irq(pdev, 0);
if (spdifrx->irq < 0) if (spdifrx->irq < 0)
...@@ -987,12 +981,9 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) ...@@ -987,12 +981,9 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
spdifrx->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "kclk", spdifrx->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "kclk",
spdifrx->base, spdifrx->base,
spdifrx->regmap_conf); spdifrx->regmap_conf);
if (IS_ERR(spdifrx->regmap)) { if (IS_ERR(spdifrx->regmap))
if (PTR_ERR(spdifrx->regmap) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(spdifrx->regmap),
dev_err(&pdev->dev, "Regmap init error %ld\n", "Regmap init error\n");
PTR_ERR(spdifrx->regmap));
return PTR_ERR(spdifrx->regmap);
}
ret = devm_request_irq(&pdev->dev, spdifrx->irq, stm32_spdifrx_isr, 0, ret = devm_request_irq(&pdev->dev, spdifrx->irq, stm32_spdifrx_isr, 0,
dev_name(&pdev->dev), spdifrx); dev_name(&pdev->dev), spdifrx);
...@@ -1002,12 +993,10 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) ...@@ -1002,12 +993,10 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
} }
rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
if (IS_ERR(rst)) { if (IS_ERR(rst))
if (PTR_ERR(rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(rst),
dev_err(&pdev->dev, "Reset controller error %ld\n", "Reset controller error\n");
PTR_ERR(rst));
return PTR_ERR(rst);
}
reset_control_assert(rst); reset_control_assert(rst);
udelay(2); udelay(2);
reset_control_deassert(rst); reset_control_deassert(rst);
...@@ -1016,11 +1005,8 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) ...@@ -1016,11 +1005,8 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
pcm_config = &stm32_spdifrx_pcm_config; pcm_config = &stm32_spdifrx_pcm_config;
ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, 0); ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, 0);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, ret, "PCM DMA register error\n");
dev_err(&pdev->dev, "PCM DMA register error %d\n", ret);
return ret;
}
ret = snd_soc_register_component(&pdev->dev, ret = snd_soc_register_component(&pdev->dev,
&stm32_spdifrx_component, &stm32_spdifrx_component,
......
...@@ -1752,8 +1752,7 @@ static int sun4i_codec_probe(struct platform_device *pdev) ...@@ -1752,8 +1752,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(scodec->gpio_pa)) { if (IS_ERR(scodec->gpio_pa)) {
ret = PTR_ERR(scodec->gpio_pa); ret = PTR_ERR(scodec->gpio_pa);
if (ret != -EPROBE_DEFER) dev_err_probe(&pdev->dev, ret, "Failed to get pa gpio\n");
dev_err(&pdev->dev, "Failed to get pa gpio: %d\n", ret);
return ret; return ret;
} }
......
...@@ -2024,13 +2024,9 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp) ...@@ -2024,13 +2024,9 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp)
tmp = mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK].filter_data; tmp = mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK].filter_data;
chan = dma_request_chan(mcasp->dev, tmp); chan = dma_request_chan(mcasp->dev, tmp);
if (IS_ERR(chan)) { if (IS_ERR(chan))
if (PTR_ERR(chan) != -EPROBE_DEFER) return dev_err_probe(mcasp->dev, PTR_ERR(chan),
dev_err(mcasp->dev, "Can't verify DMA configuration\n");
"Can't verify DMA configuration (%ld)\n",
PTR_ERR(chan));
return PTR_ERR(chan);
}
if (WARN_ON(!chan->device || !chan->device->dev)) { if (WARN_ON(!chan->device || !chan->device->dev)) {
dma_release_channel(chan); dma_release_channel(chan);
return -EINVAL; return -EINVAL;
......
...@@ -464,13 +464,9 @@ static int j721e_get_clocks(struct device *dev, ...@@ -464,13 +464,9 @@ static int j721e_get_clocks(struct device *dev,
int ret; int ret;
clocks->target = devm_clk_get(dev, prefix); clocks->target = devm_clk_get(dev, prefix);
if (IS_ERR(clocks->target)) { if (IS_ERR(clocks->target))
ret = PTR_ERR(clocks->target); return dev_err_probe(dev, PTR_ERR(clocks->target),
if (ret != -EPROBE_DEFER) "failed to acquire %s\n", prefix);
dev_err(dev, "failed to acquire %s: %d\n",
prefix, ret);
return ret;
}
clk_name = kasprintf(GFP_KERNEL, "%s-48000", prefix); clk_name = kasprintf(GFP_KERNEL, "%s-48000", prefix);
if (clk_name) { if (clk_name) {
......
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