Skip to content

Commit 4e870e6

Browse files
committed
Input: himax_hx83112b - fix incorrect size when reading product ID
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 <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202408200301.Ujpj7Vov-lkp@intel.com/ Fixes: 0944829 ("Input: himax_hx83112b - implement MCU register reading") Tested-by: Felix Kaechele <felix@kaechele.ca> Link: https://lore.kernel.org/r/ZsPdmtfC54R7JVxR@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent aaa4ca8 commit 4e870e6

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

drivers/input/touchscreen/himax_hx83112b.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,6 @@ static int himax_bus_read(struct himax_ts_data *ts, u32 address, void *dst,
130130
return 0;
131131
}
132132

133-
static int himax_read_mcu(struct himax_ts_data *ts, u32 address, u32 *dst)
134-
{
135-
int error;
136-
137-
error = himax_bus_read(ts, address, dst, sizeof(dst));
138-
if (error)
139-
return error;
140-
141-
return 0;
142-
}
143-
144133
static void himax_reset(struct himax_ts_data *ts)
145134
{
146135
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)
160149
{
161150
int error;
162151

163-
error = himax_read_mcu(ts, HIMAX_REG_ADDR_ICID, product_id);
152+
error = himax_bus_read(ts, HIMAX_REG_ADDR_ICID, product_id,
153+
sizeof(*product_id));
164154
if (error)
165155
return error;
166156

0 commit comments

Comments
 (0)