summaryrefslogtreecommitdiff
path: root/drivers/input/rmi4
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-03-25 00:28:28 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-04-04 02:23:59 +0300
commit8cf0adf2f8c3f9f30ba4f1b79e051993aea158d7 (patch)
tree65117c1c048e81a8cc8e5a93314c80a5d11ff21c /drivers/input/rmi4
parentf6c4442bfa0812efbb5d54db01a17a7ba0fc9298 (diff)
downloadlinux-8cf0adf2f8c3f9f30ba4f1b79e051993aea158d7.tar.xz
Input: synaptics-rmi4 - fix handling failures from rmi_enable_sensor
If rmi_enable_sensor() fails in rmi_driver_probe(), we should not return immediately, but disable IRQs and tear down function list. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/rmi4')
-rw-r--r--drivers/input/rmi4/rmi_driver.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index d64fc92858f2..821dc47b6eef 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -1234,16 +1234,21 @@ static int rmi_driver_probe(struct device *dev)
if (retval < 0)
goto err_destroy_functions;
- if (data->f01_container->dev.driver)
+ if (data->f01_container->dev.driver) {
/* Driver already bound, so enable ATTN now. */
- return rmi_enable_sensor(rmi_dev);
+ retval = rmi_enable_sensor(rmi_dev);
+ if (retval)
+ goto err_disable_irq;
+ }
return 0;
+err_disable_irq:
+ rmi_disable_irq(rmi_dev, false);
err_destroy_functions:
rmi_free_function_list(rmi_dev);
err:
- return retval < 0 ? retval : 0;
+ return retval;
}
static struct rmi_driver rmi_physical_driver = {