All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Lyude Paul <lyude@redhat.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Subject: [PATCH 8/9] Input: synaptics-rmi4 - simplify rmi_f34v7_start_reflash()
Date: Wed,  8 Jun 2022 14:48:07 +0200	[thread overview]
Message-ID: <20220608124808.51402-9-matthias.schiffer@ew.tq-group.com> (raw)
In-Reply-To: <20220608124808.51402-1-matthias.schiffer@ew.tq-group.com>

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@ew.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


  parent reply	other threads:[~2022-06-08 12:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 12:47 [PATCH 0/9] Input: synaptics-rmi4 - Bootloader v7/v8 firmware update improvements Matthias Schiffer
2022-06-08 12:48 ` [PATCH 1/9] Input: synaptics-rmi4 - fix firmware update operations with bootloader v8 Matthias Schiffer
2022-09-22 20:06   ` Lyude Paul
2022-09-23  9:12     ` Matthias Schiffer
2022-09-23 19:13       ` Lyude Paul
2022-06-08 12:48 ` [PATCH 2/9] Input: synaptics-rmi4 - introduce rmi_f34v7_check_command_status() helper Matthias Schiffer
2022-06-08 12:48 ` [PATCH 3/9] Input: synaptics-rmi4 - fix command completion check for bootloader v7/v8 Matthias Schiffer
2022-06-08 12:48 ` [PATCH 4/9] Input: synaptics-rmi4 - rewrite partition table unconditionally Matthias Schiffer
2022-06-08 12:48 ` [PATCH 5/9] Input: synaptics-rmi4 - reset after writing partition table Matthias Schiffer
2022-06-08 12:48 ` [PATCH 6/9] Input: synaptics-rmi4 - make rmi_f34v7_erase_all() use the "erase all" command Matthias Schiffer
2022-06-08 12:48 ` [PATCH 7/9] Input: synaptics-rmi4 - remove unneeded struct register_offset Matthias Schiffer
2022-06-08 12:48 ` Matthias Schiffer [this message]
2022-06-08 12:48 ` [PATCH 9/9] Input: synaptics-rmi4 - drop useless gotos in rmi_f34v7_do_reflash() Matthias Schiffer
2022-06-27  8:31 ` [PATCH 0/9] Input: synaptics-rmi4 - Bootloader v7/v8 firmware update improvements Matthias Schiffer
2022-08-15  7:43   ` Matthias Schiffer
2022-09-15  8:02     ` Matthias Schiffer
2022-09-16 22:39       ` Lyude Paul
2022-09-16 22:50         ` Dmitry Torokhov
2022-09-16 22:51           ` Lyude Paul
2022-09-22 20:18 ` Lyude Paul

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=20220608124808.51402-9-matthias.schiffer@ew.tq-group.com \
    --to=matthias.schiffer@ew.tq-group.com \
    --cc=Jason@zx2c4.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.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: link
Be 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.