Commit 0624dafa authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: ateml: Use dev_err_probe() helper

Use the dev_err_probe() helper, instead of open-coding the same
operation.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20211214020843.2225831-12-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7ff27fae
...@@ -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) {
......
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