]> git.baikalelectronics.ru Git - kernel.git/commit
iio: hid-sensor-attributes: Fix sensor property setting failure.
authorSong Hongyan <hongyan.song@intel.com>
Tue, 28 Mar 2017 14:23:55 +0000 (22:23 +0800)
committerJonathan Cameron <jic23@kernel.org>
Sun, 2 Apr 2017 10:44:03 +0000 (11:44 +0100)
commit9d178e6b994f0c90304997982ae0fe537fdc5e3f
treecc9faf0c93b015429ae909473fc7b5ca45527812
parent09422755e919481edb702065394d79ceb567d0f5
iio: hid-sensor-attributes: Fix sensor property setting failure.

When system bootup without get sensor property, set sensor
property will be fail.

If no get_feature operation done before set_feature, the sensor
properties will all be the initialized value, which is not the
same with sensor real properties. When set sensor property it will
write back to sensor the changed perperty data combines with other
sensor properties data, it is not right and may be dangerous.

In order to get all sensor properties, choose to read one of the sensor
properties(no matter read any sensor peroperty, driver will get all
the peroperties and return the requested one).

Fixes: 96481857f988 ("iio: hid-sensors: Common attribute and trigger")
Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/common/hid-sensors/hid-sensor-attributes.c