diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-01-26 11:53:18 +0100 |
---|---|---|
committer | Jookia <166291@gmail.com> | 2016-11-05 16:19:31 +1100 |
commit | ebc81b7fe79377a0011269bc1fd43c6def483b9d (patch) | |
tree | 1954751c31345099ff7f5b9f38d8ddcc7d8352a2 | |
parent | 16753d39744b496b3eeeea896eed7def57fdf67a (diff) | |
download | device_samsung_i9100-ebc81b7fe79377a0011269bc1fd43c6def483b9d.zip device_samsung_i9100-ebc81b7fe79377a0011269bc1fd43c6def483b9d.tar.gz device_samsung_i9100-ebc81b7fe79377a0011269bc1fd43c6def483b9d.tar.bz2 |
sensors: K3DH cannot be enabled or disabled twice in a row
Cherry-picked!
-rw-r--r-- | sensors/k3dh.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sensors/k3dh.c b/sensors/k3dh.c index 54fbfa3..955f33a 100644 --- a/sensors/k3dh.c +++ b/sensors/k3dh.c @@ -246,6 +246,9 @@ int k3dh_activate(struct smdk4210_sensors_handlers *handlers) if (handlers == NULL || handlers->data == NULL) return -EINVAL; + if (handlers->activated == 1) + return 0; + data = (struct k3dh_data *) handlers->data; device_fd = data->device_fd; @@ -277,6 +280,9 @@ int k3dh_deactivate(struct smdk4210_sensors_handlers *handlers) if (handlers == NULL || handlers->data == NULL) return -EINVAL; + if (handlers->activated == 0) + return 0; + data = (struct k3dh_data *) handlers->data; device_fd = data->device_fd; |