diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-08-16 10:44:49 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-08-20 13:41:26 +0200 |
commit | 6093f744fec77e06f98b0267ced88b9caa64eae8 (patch) | |
tree | 12effee445f1c1e7acd6189d85a576eb43deac26 /drivers/net/phy/dp83848.c | |
parent | 7fbda1306542d89984547faf6bfce584e182a541 (diff) |
can: tcan4x5x: fix data length in regmap write path
In regmap_spi_gather_write() the "addr" is prepared. The chip expects
the number of 32 bit words to write in the lower 8 bits of addr. However
the number of byte to write in shifted left by 3 (== divided by 8).
The function tcan4x5x_regmap_write() is called with a data buffer, which
holds the register information in the first 32 bits, followed by the
actual data. tcan4x5x_regmap_write() calls regmap_spi_gather_write()
with the val pointer pointing to the actual data (i.e. the original
pointer is incremented by 4 bytes), but without decrementing the count.
If the regmap framework only calls tcan4x5x_regmap_write() to read
single 32 bit registers these two bugs cancel each other.
This patch fixes the code.
Fixes: 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/phy/dp83848.c')
0 files changed, 0 insertions, 0 deletions