Re: [PATCH v4 1/2] iio: magnetometer: add support for Infineon TLV493D 3D Magentic sensor

From: Dixit Parmar
Date: Wed Aug 20 2025 - 00:46:54 EST


On Sat, Aug 16, 2025 at 02:04:48PM +0100, Jonathan Cameron wrote:
> Hi Dixit,
>
> A couple of really minor things inline. Given Andy has been doing most of the review
> work on this one I'll leave it for a few days to give him chance for a final look.
>
> The stuff below is small so if nothing else comes up I can tweak it whilst applying
>
> Thanks,
>
> Jonathan
>
> > diff --git a/drivers/iio/magnetometer/tlv493d.c b/drivers/iio/magnetometer/tlv493d.c
> > new file mode 100644
> > index 000000000000..ee72211576a6
> > --- /dev/null
> > +++ b/drivers/iio/magnetometer/tlv493d.c
> > @@ -0,0 +1,530 @@
>
> > + TLV493D_AXIS_X,
> > + TLV493D_AXIS_Y,
> > + TLV493D_AXIS_Z,
> > + TLV493D_TEMPERATURE
> As below.
>
> > +};
> > +
> > +enum tlv493d_op_mode {
> > + TLV493D_OP_MODE_POWERDOWN,
> > + TLV493D_OP_MODE_FAST,
> > + TLV493D_OP_MODE_LOWPOWER,
> > + TLV493D_OP_MODE_ULTRA_LOWPOWER,
> > + TLV493D_OP_MODE_MASTERCONTROLLED
> This is not a terminating entry, so would typically have a trailing comma.
Isn't the last entry in the enum list is termintating entry and it should
not have trailing comma?
> > +};
>
> > +
> > +static int tlv493d_init(struct tlv493d_data *data)
>
> I think this is only called from probe, so it would be appropriate
> to use return dev_err_probe() in all the error paths.
There is dev_err_probe() being called based on the return value of this
tlv493d_init(). This function reports the approproiate error(if any) and
the negative return value will result in dev_error_probe().
So I believe having single dev_err_probe() in the _probe() function would
be more appropriate, IMO.
>
> If nothing else comes up I might tweak that whilst applying.
Much appreciated.

Thank you,
Dixit Parmar