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:
Kuninori Morimoto 2021-12-14 11:08:32 +09:00 committed by Mark Brown
parent 7ff27faec8
commit 0624dafa6a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 15 additions and 23 deletions

View File

@ -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;
} }

View File

@ -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) {