UPSTREAM: spi: rockchip: covert rsd_nsecs to u32 type
authorShawn Lin <shawn.lin@rock-chips.com>
Thu, 10 Mar 2016 06:52:27 +0000 (14:52 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 16 Jun 2016 12:58:18 +0000 (20:58 +0800)
rsd_nsecs is defined as u8 memeber of struct rockchip_spi,
but using of_property_read_u32. That means we take risk of
truncation by type conversion if we pass on big value from
dt.

Change-Id: I4d3e29b64749ac8a86782413d0f41691b9ff4e84
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from git.kernel.org next/linux-next.git master
 commit 108b5c8bba6be101100596bf37a165214e1c8458)

drivers/spi/spi-rockchip.c

index 7a4a131cdbd8ddee26bc84afd741168e1c7d1bae..26e2688c104ec9e6ba314264b63318a65048596f 100644 (file)
@@ -173,7 +173,7 @@ struct rockchip_spi {
        u8 tmode;
        u8 bpw;
        u8 n_bytes;
-       u8 rsd_nsecs;
+       u32 rsd_nsecs;
        unsigned len;
        u32 speed;