On Mon, 18 Jul 2022 13:43:12 -0500 Chris Morgan <macroalpha82@xxxxxxxxx> wrote: > From: Chris Morgan <macromorgan@xxxxxxxxxxx> > > Copy the scan_type details from the parent iio channel to the child. > The scan_type is otherwise empty and things like the storagebits are > zero (which causes a problem for the adc-joystick driver which > validates the storagebits when used through a mux). I'm submitting this > as an RFC because I'm not sure if this is the correct way to handle > this scenario (a driver that checks the storagebits used with the iio > multiplexer). > > Signed-off-by: Chris Morgan <macromorgan@xxxxxxxxxxx> Seems sensible to me. Though Peter is expert on this one. One comment on the comment inline... > --- > drivers/iio/multiplexer/iio-mux.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/iio/multiplexer/iio-mux.c b/drivers/iio/multiplexer/iio-mux.c > index 93558fddfa9b..1de01ec878c4 100644 > --- a/drivers/iio/multiplexer/iio-mux.c > +++ b/drivers/iio/multiplexer/iio-mux.c > @@ -322,6 +322,9 @@ static int mux_configure_channel(struct device *dev, struct mux *mux, > if (page) > devm_kfree(dev, page); > > + /* Copy scan type from parent to mux child. */ Comment is in the obvious category, so drop that. > + chan->scan_type = pchan->scan_type; > + > return 0; > } >