From: Zhouyang Jia <jiazhouyang09@gmail.com> To: unlisted-recipients:; (no To-header on input) Cc: Zhouyang Jia <jiazhouyang09@gmail.com>, Support Opensource <support.opensource@diasemi.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: add error handling for da9052_reg_write Date: Mon, 11 Jun 2018 13:23:39 +0800 [thread overview] Message-ID: <1528694619-31889-1-git-send-email-jiazhouyang09@gmail.com> (raw) When da9052_reg_write fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling da9052_reg_write. Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com> --- drivers/input/touchscreen/da9052_tsi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c index b5dfd594..60c82a0 100644 --- a/drivers/input/touchscreen/da9052_tsi.c +++ b/drivers/input/touchscreen/da9052_tsi.c @@ -319,8 +319,11 @@ static int da9052_ts_probe(struct platform_device *pdev) static int da9052_ts_remove(struct platform_device *pdev) { struct da9052_tsi *tsi = platform_get_drvdata(pdev); + int error; - da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x19); + error = da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x19); + if (error < 0) + return error; da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi); da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi); -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Zhouyang Jia <jiazhouyang09@gmail.com> Cc: Zhouyang Jia <jiazhouyang09@gmail.com>, Support Opensource <support.opensource@diasemi.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: add error handling for da9052_reg_write Date: Mon, 11 Jun 2018 13:23:39 +0800 [thread overview] Message-ID: <1528694619-31889-1-git-send-email-jiazhouyang09@gmail.com> (raw) When da9052_reg_write fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling da9052_reg_write. Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com> --- drivers/input/touchscreen/da9052_tsi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c index b5dfd594..60c82a0 100644 --- a/drivers/input/touchscreen/da9052_tsi.c +++ b/drivers/input/touchscreen/da9052_tsi.c @@ -319,8 +319,11 @@ static int da9052_ts_probe(struct platform_device *pdev) static int da9052_ts_remove(struct platform_device *pdev) { struct da9052_tsi *tsi = platform_get_drvdata(pdev); + int error; - da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x19); + error = da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x19); + if (error < 0) + return error; da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi); da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi); -- 2.7.4
next reply other threads:[~2018-06-11 5:24 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-06-11 5:23 Zhouyang Jia [this message] 2018-06-11 5:23 ` [PATCH] Input: add error handling for da9052_reg_write Zhouyang Jia 2018-06-11 17:30 ` Dmitry Torokhov 2018-06-12 5:37 ` Steve Twiss
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=1528694619-31889-1-git-send-email-jiazhouyang09@gmail.com \ --to=jiazhouyang09@gmail.com \ --cc=dmitry.torokhov@gmail.com \ --cc=linux-input@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=support.opensource@diasemi.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.