summaryrefslogtreecommitdiffstats
path: root/sensors
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-01-26 11:53:18 +0100
committerPaul Kocialkowski <contact@paulk.fr>2014-01-26 11:53:18 +0100
commitdcf50758c98e4f8bf067fcb8f9462ddb1b41fe81 (patch)
tree9cbb0e15dfea96e3a83ef49f1b4b9f66f481df11 /sensors
parent46807f8553f595282ba66372a6510724a79aca7e (diff)
downloaddevice_samsung_i9100-replicant-4.2-0003.zip
device_samsung_i9100-replicant-4.2-0003.tar.gz
device_samsung_i9100-replicant-4.2-0003.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>
Diffstat (limited to 'sensors')
-rw-r--r--sensors/k3dh.c6
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;