[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220608124808.51402-9-matthias.schiffer@ew.tq-group.com>
Date: Wed, 8 Jun 2022 14:48:07 +0200
From: Matthias Schiffer <matthias.schiffer@...tq-group.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Lyude Paul <lyude@...hat.com>,
"Jason A. Donenfeld" <Jason@...c4.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Matthias Schiffer <matthias.schiffer@...tq-group.com>
Subject: [PATCH 8/9] Input: synaptics-rmi4 - simplify rmi_f34v7_start_reflash()
rmi_f34v7_enter_flash_prog() already enables IRQs and checks the flash
status - there's no need for rmi_f34v7_start_reflash() to do the same just
before calling rmi_f34v7_enter_flash_prog().
Signed-off-by: Matthias Schiffer <matthias.schiffer@...tq-group.com>
---
drivers/input/rmi4/rmi_f34v7.c | 25 ++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/drivers/input/rmi4/rmi_f34v7.c b/drivers/input/rmi4/rmi_f34v7.c
index 5c22ad4bcc74..f16c67eb6cc6 100644
--- a/drivers/input/rmi4/rmi_f34v7.c
+++ b/drivers/input/rmi4/rmi_f34v7.c
@@ -1107,8 +1107,11 @@ static int rmi_f34v7_enter_flash_prog(struct f34_data *f34)
if (ret < 0)
return ret;
- if (f34->v7.in_bl_mode)
+ if (f34->v7.in_bl_mode) {
+ dev_info(&f34->fn->dev, "%s: Device in bootloader mode\n",
+ __func__);
return 0;
+ }
init_completion(&f34->v7.cmd_done);
@@ -1127,32 +1130,16 @@ int rmi_f34v7_start_reflash(struct f34_data *f34, const struct firmware *fw)
{
int ret = 0;
- f34->fn->rmi_dev->driver->set_irq_bits(f34->fn->rmi_dev, f34->fn->irq_mask);
-
f34->v7.config_area = v7_UI_CONFIG_AREA;
f34->v7.image = fw->data;
ret = rmi_f34v7_parse_image_info(f34);
if (ret < 0)
- goto exit;
+ return ret;
dev_info(&f34->fn->dev, "Firmware image OK\n");
- ret = rmi_f34v7_read_flash_status(f34);
- if (ret < 0)
- goto exit;
-
- if (f34->v7.in_bl_mode) {
- dev_info(&f34->fn->dev, "%s: Device in bootloader mode\n",
- __func__);
- }
-
- rmi_f34v7_enter_flash_prog(f34);
-
- return 0;
-
-exit:
- return ret;
+ return rmi_f34v7_enter_flash_prog(f34);
}
int rmi_f34v7_probe(struct f34_data *f34)
--
2.25.1
Powered by blists - more mailing lists