diff mbox series

[3/3] iio: humidity: dht11: Use dev_err_probe consistently

Message ID 20220718193520.177648-3-ukleinek@debian.org (mailing list archive)
State Changes Requested
Headers show
Series [1/3] iio: humidity: dht11: Don't warn on memory allocation failure | expand

Commit Message

Uwe Kleine-König July 18, 2022, 7:35 p.m. UTC
All but one error path use dev_err_probe() to emit a message. Use the same
incarnation for the remaining exit point for consistency.

Signed-off-by: Uwe Kleine-König <ukleinek@debian.org>
---
 drivers/iio/humidity/dht11.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c
index 6182f4d2e9fc..50d2431c938b 100644
--- a/drivers/iio/humidity/dht11.c
+++ b/drivers/iio/humidity/dht11.c
@@ -306,10 +306,9 @@  static int dht11_probe(struct platform_device *pdev)
 				     "Failed to aquire GPIO\n");
 
 	dht11->irq = gpiod_to_irq(dht11->gpiod);
-	if (dht11->irq < 0) {
-		dev_err(dev, "GPIO %d has no interrupt\n", desc_to_gpio(dht11->gpiod));
-		return -EINVAL;
-	}
+	if (dht11->irq < 0)
+		return dev_err_probe(dev, -EINVAL, "GPIO %d has no interrupt\n",
+				     desc_to_gpio(dht11->gpiod));
 
 	dht11->timestamp = ktime_get_boottime_ns() - DHT11_DATA_VALID_TIME - 1;
 	dht11->num_edges = -1;