[PATCH v5 03/10] iio: adc: ti-ads1015: return -ENODATA when match data is missing
From: Archit Anant
Date: Wed Sep 30 2026 - 14:29:09 EST
When i2c_get_match_data() returns NULL, it indicates that driver match
data is absent rather than an invalid argument being provided.
Return -ENODATA instead of -EINVAL to more accurately reflect the failure.
Signed-off-by: Archit Anant <architanant5@xxxxxxxxx>
---
drivers/iio/adc/ti-ads1015.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index ef03b74bda3e..9479f110448d 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -951,7 +951,7 @@ static int ads1015_probe(struct i2c_client *client)
chip = i2c_get_match_data(client);
if (!chip)
- return dev_err_probe(&client->dev, -EINVAL, "Unknown chip\n");
+ return dev_err_probe(&client->dev, -ENODATA, "Unknown chip\n");
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev)
--
2.39.5