mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
ASoC: ateml: Use dev_err_probe() helper
Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/20211214020843.2225831-12-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7ff27faec8
commit
0624dafa6a
@ -144,9 +144,9 @@ static int snd_proto_probe(struct platform_device *pdev)
|
||||
of_node_put(cpu_np);
|
||||
|
||||
ret = snd_soc_register_card(&snd_proto);
|
||||
if (ret && ret != -EPROBE_DEFER)
|
||||
dev_err(&pdev->dev,
|
||||
"snd_soc_register_card() failed: %d\n", ret);
|
||||
if (ret)
|
||||
dev_err_probe(&pdev->dev, ret,
|
||||
"snd_soc_register_card() failed\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -371,35 +371,27 @@ static int tse850_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
tse850->add = devm_gpiod_get(dev, "axentia,add", GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(tse850->add)) {
|
||||
if (PTR_ERR(tse850->add) != -EPROBE_DEFER)
|
||||
dev_err(dev, "failed to get 'add' gpio\n");
|
||||
return PTR_ERR(tse850->add);
|
||||
}
|
||||
if (IS_ERR(tse850->add))
|
||||
return dev_err_probe(dev, PTR_ERR(tse850->add),
|
||||
"failed to get 'add' gpio\n");
|
||||
tse850->add_cache = 1;
|
||||
|
||||
tse850->loop1 = devm_gpiod_get(dev, "axentia,loop1", GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(tse850->loop1)) {
|
||||
if (PTR_ERR(tse850->loop1) != -EPROBE_DEFER)
|
||||
dev_err(dev, "failed to get 'loop1' gpio\n");
|
||||
return PTR_ERR(tse850->loop1);
|
||||
}
|
||||
if (IS_ERR(tse850->loop1))
|
||||
return dev_err_probe(dev, PTR_ERR(tse850->loop1),
|
||||
"failed to get 'loop1' gpio\n");
|
||||
tse850->loop1_cache = 1;
|
||||
|
||||
tse850->loop2 = devm_gpiod_get(dev, "axentia,loop2", GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(tse850->loop2)) {
|
||||
if (PTR_ERR(tse850->loop2) != -EPROBE_DEFER)
|
||||
dev_err(dev, "failed to get 'loop2' gpio\n");
|
||||
return PTR_ERR(tse850->loop2);
|
||||
}
|
||||
if (IS_ERR(tse850->loop2))
|
||||
return dev_err_probe(dev, PTR_ERR(tse850->loop2),
|
||||
"failed to get 'loop2' gpio\n");
|
||||
tse850->loop2_cache = 1;
|
||||
|
||||
tse850->ana = devm_regulator_get(dev, "axentia,ana");
|
||||
if (IS_ERR(tse850->ana)) {
|
||||
if (PTR_ERR(tse850->ana) != -EPROBE_DEFER)
|
||||
dev_err(dev, "failed to get 'ana' regulator\n");
|
||||
return PTR_ERR(tse850->ana);
|
||||
}
|
||||
if (IS_ERR(tse850->ana))
|
||||
return dev_err_probe(dev, PTR_ERR(tse850->ana),
|
||||
"failed to get 'ana' regulator\n");
|
||||
|
||||
ret = regulator_enable(tse850->ana);
|
||||
if (ret < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user