diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-30 09:39:12 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-01 07:36:22 +1000 |
commit | d1301412d7b7acd6325f0561c109f2b8e1c7a999 (patch) | |
tree | d86123f0482ceceb43ab6d3efd0b5cb7d56f97a3 /src/synaptics.c | |
parent | 2603ad69b997c999404ecc441e0d64ea2cc22018 (diff) |
Return true/false from SetDeviceAndProtocol
Instead of requiring the caller to know which private field indicates
failure, just return true on success or false on failure.
No functional change.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'src/synaptics.c')
-rw-r--r-- | src/synaptics.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 1c9b6db..8fbddc8 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -265,7 +265,7 @@ SanitizeDimensions(InputInfoPtr pInfo) } } -static void +static Bool SetDeviceAndProtocol(InputInfoPtr pInfo) { SynapticsPrivate *priv = pInfo->private; @@ -286,6 +286,8 @@ SetDeviceAndProtocol(InputInfoPtr pInfo) free(device); priv->proto_ops = protocols[i].proto_ops; + + return (priv->proto_ops != NULL); } /* @@ -714,8 +716,7 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) } /* may change pInfo->options */ - SetDeviceAndProtocol(pInfo); - if (priv->proto_ops == NULL) { + if (!SetDeviceAndProtocol(pInfo)) { xf86IDrvMsg(pInfo, X_ERROR, "Synaptics driver unable to detect protocol\n"); goto SetupProc_fail; } |