diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-01-26 11:53:18 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-01-26 11:53:18 +0100 |
commit | dcf50758c98e4f8bf067fcb8f9462ddb1b41fe81 (patch) | |
tree | 9cbb0e15dfea96e3a83ef49f1b4b9f66f481df11 | |
parent | 46807f8553f595282ba66372a6510724a79aca7e (diff) | |
download | device_samsung_i9100-replicant-4.2-0002.zip device_samsung_i9100-replicant-4.2-0002.tar.gz device_samsung_i9100-replicant-4.2-0002.tar.bz2 |
sensors: K3DH cannot be enabled or disabled twice in a rowreplicant-4.2-0004replicant-4.2-0003replicant-4.2-0002replicant-4.2
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-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; |