wlcore: spi: Use dev_err_probe()

Use the existing dev_err_probe() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/465e76901b801ac0755088998249928fd546c08a.1634647460.git.geert+renesas@glider.be
This commit is contained in:
Geert Uytterhoeven 2021-10-19 14:48:41 +02:00 коммит произвёл Kalle Valo
Родитель de904d80aa
Коммит 1aa3367ca7
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -488,12 +488,9 @@ static int wl1271_probe(struct spi_device *spi)
spi->bits_per_word = 32;
glue->reg = devm_regulator_get(&spi->dev, "vwlan");
if (PTR_ERR(glue->reg) == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (IS_ERR(glue->reg)) {
dev_err(glue->dev, "can't get regulator\n");
return PTR_ERR(glue->reg);
}
if (IS_ERR(glue->reg))
return dev_err_probe(glue->dev, PTR_ERR(glue->reg),
"can't get regulator\n");
ret = wlcore_probe_of(spi, glue, pdev_data);
if (ret) {