diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-07-22 11:44:35 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-07-22 11:54:09 +1000 |
commit | a9d25b818d364594bfb761a996a86db002a7d4ac (patch) | |
tree | 5d26292165c6b587175540ea727290643a3368b1 | |
parent | 4dd15cf37d388a720e502f364410c28f17e03ce6 (diff) |
Reshuffle initialization in preparation for new input API.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/synaptics.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index a60a336..4f46bbd 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -650,25 +650,10 @@ static InputInfoPtr SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags) { LocalDevicePtr local; - SynapticsPrivate *priv; - - /* allocate memory for SynapticsPrivateRec */ - priv = calloc(1, sizeof(SynapticsPrivate)); - if (!priv) - return NULL; - - /* allocate now so we don't allocate in the signal handler */ - priv->timer = TimerSet(NULL, 0, 0, NULL, NULL); - if (!priv->timer) { - free(priv); - return NULL; - } /* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */ local = xf86AllocateInput(drv, 0); if (!local) { - free(priv->timer); - free(priv); return NULL; } @@ -695,6 +680,18 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags) xf86OptionListReport(local->options); + /* allocate memory for SynapticsPrivateRec */ + priv = calloc(1, sizeof(SynapticsPrivate)); + if (!priv) + return NULL; + + /* allocate now so we don't allocate in the signal handler */ + priv->timer = TimerSet(NULL, 0, 0, NULL, NULL); + if (!priv->timer) { + free(priv); + return NULL; + } + /* may change local->options */ SetDeviceAndProtocol(local); |