Re: [PATCH] iio: magnetometer: ak8974: Fix negative raw values in sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 14, 2020 at 12:04 PM Stephan Gerhold <stephan@xxxxxxxxxxx> wrote:

> At the moment, reading from in_magn_*_raw in sysfs tends to return
> large values around 65000, even though the output of ak8974 is actually
> limited to ±32768. This happens because the value is never converted
> to the signed 16-bit integer variant.
>
> Add an explicit cast to s16 to fix this.
>
> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Fixes: 7c94a8b2ee8c ("iio: magn: add a driver for AK8974")
> Signed-off-by: Stephan Gerhold <stephan@xxxxxxxxxxx>

Reviewed-by: Linus Waleij <linus.walleij@xxxxxxxxxx>

It's my bug, thanks for fixing!

Yours,
Linus Walleij




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux