On Mon, 31 Mar 2025 21:02:48 +0200 Angelo Dureghello <adureghello@xxxxxxxxxxxx> wrote: > From: Angelo Dureghello <adureghello@xxxxxxxxxxxx> > > The ad3552r can be feeded from the HDL controller by an internally > generated 16bit ramp, useful for debug pourposes. Add debugfs a file > to enable or disable it. > > Signed-off-by: Angelo Dureghello <adureghello@xxxxxxxxxxxx> A couple of really minor things inline. > --- > drivers/iio/dac/ad3552r-hs.c | 122 ++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 116 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/dac/ad3552r-hs.c b/drivers/iio/dac/ad3552r-hs.c > index 37397e188f225a8099745ec03f7c604da76960b1..d4f50b33565f99b90859e30571dc59038d01361c 100644 > --- a/drivers/iio/dac/ad3552r-hs.c > +++ b/drivers/iio/dac/ad3552r-hs.c > @@ -7,6 +7,7 @@ > */ > > #include <linux/bitfield.h> > +#include <linux/debugfs.h> > #include <linux/delay.h> > #include <linux/gpio/consumer.h> > #include <linux/iio/backend.h> > @@ -54,8 +55,12 @@ struct ad3552r_hs_state { > struct ad3552r_hs_platform_data *data; > /* INTERFACE_CONFIG_D register cache, in DDR we cannot read values. */ > u32 config_d; > + struct mutex lock; Minor thing but all locks need comments. What data is this lock protecting? > }; ... > static int ad3552r_hs_probe(struct platform_device *pdev) > { > struct ad3552r_hs_state *st; > @@ -705,7 +806,16 @@ static int ad3552r_hs_probe(struct platform_device *pdev) > if (ret) > return ret; > > - return devm_iio_device_register(&pdev->dev, indio_dev); > + ret = devm_iio_device_register(&pdev->dev, indio_dev); > + if (ret) > + return ret; > + > + mutex_init(&st->lock); For new code, I'd prefer ret = devm_mutex_init(&st->lock); if (ret) return ret; Brings only a small advantage, but give the complexity cost is also small we might as well use it! > + > + ad3552r_hs_debugfs_init(indio_dev); > + > + return ret; > + > } > > static const struct of_device_id ad3552r_hs_of_id[] = { >