summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-01-26 11:54:55 +0100
committerPaul Kocialkowski <contact@paulk.fr>2014-01-26 11:54:55 +0100
commit1d609fe30d1e59a04638e9e6c57fb3cfeead7259 (patch)
tree67df4eba63eb866507ae4d7ec15b7779c431e66c
parentf8f404410d88f2cc87d3869f99cc8ea439f3ce39 (diff)
downloaddevice_samsung_n7000-replicant-4.2.zip
device_samsung_n7000-replicant-4.2.tar.gz
device_samsung_n7000-replicant-4.2.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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sensors/k3dh.c b/sensors/k3dh.c
index aa80292..6335122 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;