]> Git Repo - J-linux.git/commitdiff
Input: himax_hx83112b - fix incorrect size when reading product ID
authorDmitry Torokhov <[email protected]>
Tue, 20 Aug 2024 00:04:42 +0000 (17:04 -0700)
committerDmitry Torokhov <[email protected]>
Tue, 20 Aug 2024 00:29:14 +0000 (17:29 -0700)
We need to read a u32 value (4 bytes), not size of a pointer to that
value.

Also, himax_read_mcu() wrapper is an overkill, remove it and use
himax_bus_read() directly.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Fixes: 0944829d491e ("Input: himax_hx83112b - implement MCU register reading")
Tested-by: Felix Kaechele <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/touchscreen/himax_hx83112b.c

index 9ed3bccde4ac4a4ce2de00c247dccb57608e0dcf..896a145ddb2bc21c2e7c8447d5b6506e993eb1ad 100644 (file)
@@ -130,17 +130,6 @@ static int himax_bus_read(struct himax_ts_data *ts, u32 address, void *dst,
        return 0;
 }
 
-static int himax_read_mcu(struct himax_ts_data *ts, u32 address, u32 *dst)
-{
-       int error;
-
-       error = himax_bus_read(ts, address, dst, sizeof(dst));
-       if (error)
-               return error;
-
-       return 0;
-}
-
 static void himax_reset(struct himax_ts_data *ts)
 {
        gpiod_set_value_cansleep(ts->gpiod_rst, 1);
@@ -160,7 +149,8 @@ static int himax_read_product_id(struct himax_ts_data *ts, u32 *product_id)
 {
        int error;
 
-       error = himax_read_mcu(ts, HIMAX_REG_ADDR_ICID, product_id);
+       error = himax_bus_read(ts, HIMAX_REG_ADDR_ICID, product_id,
+                              sizeof(*product_id));
        if (error)
                return error;
 
This page took 0.046694 seconds and 4 git commands to generate.