]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Revert "Input: rmi4 - fix register descriptor address calculation"
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 27 Jun 2026 00:42:10 +0000 (17:42 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 27 Jun 2026 05:22:42 +0000 (22:22 -0700)
The register descriptor presence register is a packet register, which
means its bytes share a single RMI address. It does not occupy
consecutive addresses, and the register structure that follows it
is located at the next RMI address (presence_address + 1), not
(presence_address + presence_size).

Revert the incorrect address calculation introduced in commit
a98518e72439.

Reported-by: "Barry K. Nathan" <barryn@pobox.com>
Tested-by: "Barry K. Nathan" <barryn@pobox.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/rmi4/rmi_driver.c

index 49a59da6a84111fb812064a91140aa59e2f4db1c..a28eef1b765e53098313feff34f2967356344285 100644 (file)
@@ -643,7 +643,7 @@ int rmi_read_register_desc(struct rmi_device *d, u16 addr,
        ret = rmi_read_block(d, addr, buf, size_presence_reg);
        if (ret)
                return ret;
-       addr += size_presence_reg;
+       ++addr;
 
        if (buf[0] == 0) {
                if (size_presence_reg < 3)