summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-05-21 12:10:30 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-31 14:56:48 +1000
commit64006101c24621c443b90ed54509bdeb0853dce9 (patch)
treebc173c43e2748b3a8a88802f85521a2a78ac4fea
parent12bb1b40cdece9068937a8206e2028f6de8e8bc0 (diff)
Drop the fd from the SynapticsPrivate
We have the fd passed through all functions that need it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics-x11.c12
-rw-r--r--src/synapticsstr.h1
-rw-r--r--test/eventcomm-test.c3
3 files changed, 2 insertions, 14 deletions
diff --git a/src/synaptics-x11.c b/src/synaptics-x11.c
index 1687853..18f587c 100644
--- a/src/synaptics-x11.c
+++ b/src/synaptics-x11.c
@@ -385,8 +385,6 @@ DeviceOn(DeviceIntPtr dev)
return !Success;
}
- priv->fd = pInfo->fd;
-
if (priv->proto_ops->DeviceOnHook &&
!priv->proto_ops->DeviceOnHook(priv, &priv->synpara, pInfo->fd))
return !Success;
@@ -394,7 +392,7 @@ DeviceOn(DeviceIntPtr dev)
xf86FlushInput(pInfo->fd);
/* reinit the pad */
- if (!SynapticsQueryHardware(priv, priv->fd)) {
+ if (!SynapticsQueryHardware(priv, pInfo->fd)) {
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
return !Success;
@@ -424,7 +422,6 @@ DeviceOff(DeviceIntPtr dev)
rc = !Success;
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
- priv->fd = -1;
}
dev->public.on = FALSE;
return rc;
@@ -747,10 +744,8 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
}
xf86ErrorFVerb(6, "port opened successfully\n");
- priv->fd = pInfo->fd;
-
/* read hardware dimensions */
- if (!SynapticsQueryHardware(priv, priv->fd)) {
+ if (!SynapticsQueryHardware(priv, pInfo->fd)) {
xf86IDrvMsg(pInfo, MSG_ERROR,
"Unable to query/initialize Synaptics hardware.\n");
goto SetupProc_fail;
@@ -764,7 +759,6 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
if (pInfo->fd != -1)
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
- priv->fd = -1;
return Success;
@@ -772,8 +766,6 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
if (pInfo->fd >= 0) {
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
- if (priv)
- priv->fd = -1;
}
FreeX11Private(&x11);
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 88d8d4c..3c26d06 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -204,7 +204,6 @@ struct _SynapticsPrivateRec {
struct SynapticsProtocolOperations *proto_ops;
void *proto_data; /* protocol-specific data */
void *frontend_data; /* frontend-specific data */
- int fd; /* device file descriptor */
struct SynapticsHwState *hwState;
struct SynapticsHwState *old_hw_state; /* previous logical hw state */
diff --git a/test/eventcomm-test.c b/test/eventcomm-test.c
index 52d5e5a..ae434a5 100644
--- a/test/eventcomm-test.c
+++ b/test/eventcomm-test.c
@@ -140,8 +140,6 @@ test_read_hw_state(void)
memset(&private, 0, sizeof(private));
- private.fd = fd_read;
-
private.proto_data = EventProtoDataAlloc();
/* just the syn event */
@@ -264,7 +262,6 @@ test_ignore_hw_state(void)
struct input_event ev = { {0, 0}, 0, 0, 1 };
memset(&private, 0, sizeof(private));
- private.fd = fd_read;
private.proto_data = EventProtoDataAlloc();