Re: [PATCH v6 9/9] iio: accel: mma8452: Use proper error code when missing device model
Esben Haabendal <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
"Joshua Crofts" <[email protected]> writes: > On Tue, 25 Aug 2026 10:27:47 +0200 > Esben Haabendal <[email protected]> wrote: > >> The device is there, but we don't have data describing how to use it. > > A bit of a weird commit message IMO, :) > I'd do > > Switch -ENODEV error on i2c_get_match_data() failure to -ENODATA to > satisfy the IIO coding style. (but this is only my opinion). Sounds good to me. I will update for next version, if needed. But feel free to make the change when merging. /Esben > (We recently had a few conversations about -ENODEV vs. -ENODATA and > while there are a lot of uses of -ENODEV in IIO they should be replaced > with -ENODATA when checking *_get_match_data() results). > >> >> Signed-off-by: Esben Haabendal <[email protected]> >> --- >> drivers/iio/accel/mma8452.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c >> index 4a1eb196589a..42e3371cdb1d 100644 >> --- a/drivers/iio/accel/mma8452.c >> +++ b/drivers/iio/accel/mma8452.c >> @@ -1595,7 +1595,7 @@ static int mma8452_probe(struct i2c_client *client) >> >> data->chip_info = i2c_get_match_data(client); >> if (!data->chip_info) >> - return dev_err_probe(dev, -ENODEV, "unknown device model\n"); >> + return dev_err_probe(dev, -ENODATA, "unknown device model\n"); >> >> ret = iio_read_mount_matrix(dev, &data->orientation); >> if (ret) >> > > Reviewed-by: Joshua Crofts <[email protected]> > > -- > Kind regards, > Joshua Crofts