Re: [PATCH 10/11] staging: iio: adt7316: change interpretation of write to dac update mode

From: Dan Carpenter
Date: Wed Dec 12 2018 - 03:32:20 EST


On Tue, Dec 11, 2018 at 05:55:02PM -0700, Jeremy Fertic wrote:
> Based on the output of adt7316_show_all_DAC_update_modes() and
> adt7316_show_DAC_update_mode(), adt7316_store_DAC_update_mode() should
> expect the user to enter an integer input from 0 to 3. The user input is
> currently expected to account for the actual bit positions in the register.
> For example, choosing option 3 would require a write of 0x30 (actually 48
> since it expects base 10). To address this inconsistency, create a shift
> macro to be used in the valid input check as well as the calculation for
> the register write.
>
> Signed-off-by: Jeremy Fertic <jeremyfertic@xxxxxxxxx>
> ---
> I'm not sure if this patch is appropriate since it's making a user visible
> change. I've included it since the driver is still in staging.

We don't want to break user space, but I agree with you that applying
this patch is probably the right thing.

regards,
dan carpenter