[PATCH v6 04/11] iio: adc: ti-ads1015: return -ENODATA when match data is missing
From: Archit Anant
Date: Mon Nov 09 2026 - 12:05:06 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 af3ba6b75c410..d18a2ac1205ff 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -974,7 +974,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(dev, -ENODATA, "Unknown chip\n");
indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
if (!indio_dev)
--
2.39.5