OSDN Git Service

STPK-1429 Make the sensor enable/disable code path more robust
authorPatrick Porlan <patrick.porlan@intel.com>
Mon, 7 Apr 2014 12:31:41 +0000 (14:31 +0200)
committersuyyala <sridhar.uyyala@intel.com>
Mon, 28 Apr 2014 02:40:39 +0000 (19:40 -0700)
commit93e42e580d09229d32e9254bcfe6424e38b8fcaa
treed575de0b2bfbd34471b12af8aa4f80464120e1c5
parentd6f3b774caa35823f381ba6da33f1f8ae559c263
STPK-1429 Make the sensor enable/disable code path more robust

Tests on the number of enabled sensors can be replaced by a
check on the iio device fd status (having any sensor active
on a iio device implies that the associated device was open).

This simplifies the enable path somewhat. On the disable path
we still need to check whether a regular or poll-mode sensor
associated to the device remains in operation before actually
closing the fd and setting it back to -1.

Issue: STPK-1429

Change-Id: Ib3084d0075630d48ffb97bcdd01b880271b3192c
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
control.c