From d1301412d7b7acd6325f0561c109f2b8e1c7a999 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 30 Nov 2011 09:39:12 +1000 Subject: 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 Reviewed-by: Chase Douglas Reviewed-by: Jeremy Huddleston --- src/synaptics.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/synaptics.c') 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; } -- cgit v1.2.3