diff mbox series

net: wlcore: spi: Use dev_err_probe()

Message ID 465e76901b801ac0755088998249928fd546c08a.1634647460.git.geert+renesas@glider.be (mailing list archive)
State Accepted
Commit 1aa3367ca78ce6c1b06726587da1a6d8aa387797
Delegated to: Kalle Valo
Headers show
Series net: wlcore: spi: Use dev_err_probe() | expand

Commit Message

Geert Uytterhoeven Oct. 19, 2021, 12:48 p.m. UTC
Use the existing dev_err_probe() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
 drivers/net/wireless/ti/wlcore/spi.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Kalle Valo Oct. 27, 2021, 7:32 a.m. UTC | #1
Geert Uytterhoeven <geert+renesas@glider.be> wrote:

> Use the existing dev_err_probe() helper instead of open-coding the same
> operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Patch applied to wireless-drivers-next.git, thanks.

1aa3367ca78c wlcore: spi: Use dev_err_probe()
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index f26fc150ecd01460..354a7e1c3315c6e2 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -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) {