From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Andrew Duggan <aduggan@synaptics.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Nick Dyer <nick@shmanahar.org>
Subject: [PATCH 1/4] Input: synaptics-rmi4 - fix handling failures from rmi_enable_sensor
Date: Fri, 24 Mar 2017 23:00:47 -0700 [thread overview]
Message-ID: <20170325060050.39867-1-dmitry.torokhov@gmail.com> (raw)
If rmi_enable_sensor() fails in rmi_driver_probe(), we should not return
immediately, but disable IRQs and tear down function list.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/rmi4/rmi_driver.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index d9cfe4ec93fa..daba87c7e707 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -1229,16 +1229,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 = {
--
2.12.1.578.ge9c3154ca4-goog
next reply other threads:[~2017-03-25 6:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-25 6:00 Dmitry Torokhov [this message]
2017-03-25 6:00 ` [PATCH 2/4] Input: synaptics-rmi4 - fix endianness issue in SMBus transport Dmitry Torokhov
2017-03-31 9:15 ` Benjamin Tissoires
2017-03-25 6:00 ` [PATCH 3/4] Input: synaptics-rmi4 - cleanup SMbus mapping handling Dmitry Torokhov
2017-03-31 9:21 ` Benjamin Tissoires
2017-03-25 6:00 ` [PATCH 4/4] Input: synaptics-rmi4 - when registering sensors do not call them "drivers" Dmitry Torokhov
2017-03-31 9:28 ` Benjamin Tissoires
2017-03-31 9:15 ` [PATCH 1/4] Input: synaptics-rmi4 - fix handling failures from rmi_enable_sensor Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170325060050.39867-1-dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=aduggan@synaptics.com \
--cc=benjamin.tissoires@redhat.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@shmanahar.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox