From fbec1ad4efbdd01759cd4d2e22d27281bd5b1626 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Sat, 9 Apr 2016 13:04:54 -0700 Subject: rockchip/common: do not retrieve register pointer twice The driver interface function derives the driver specific pointer from the API provided handle, no need to use the handle in the local functions. BRANCH=none BUG=none TEST=SPI interface with the flash ROM is still working properly. Change-Id: I7725b658365473c733698ca050e780d1dd5072d9 Signed-off-by: Patrick Georgi Original-Commit-Id: a2b42779785623bd1234ab2dfb0b4db76c890fc7 Original-Change-Id: I9d657dc23540e9eac52d2dbfc551ed32b7fa98f0 Original-Signed-off-by: Vadim Bendebury Original-Reviewed-on: https://chromium-review.googlesource.com/338090 Original-Reviewed-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/14318 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Martin Roth --- src/soc/rockchip/common/spi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/soc/rockchip/common') diff --git a/src/soc/rockchip/common/spi.c b/src/soc/rockchip/common/spi.c index b08509fe07..814f0b5515 100644 --- a/src/soc/rockchip/common/spi.c +++ b/src/soc/rockchip/common/spi.c @@ -183,10 +183,9 @@ static void set_transfer_mode(struct rockchip_spi *regs, } /* returns 0 to indicate success, <0 otherwise */ -static int do_xfer(struct spi_slave *slave, const void *dout, - unsigned int *bytes_out, void *din, unsigned int *bytes_in) +static int do_xfer(struct rockchip_spi *regs, const void *dout, + unsigned int *bytes_out, void *din, unsigned int *bytes_in) { - struct rockchip_spi *regs = to_rockchip_spi(slave)->regs; uint8_t *in_buf = din; uint8_t *out_buf = (uint8_t *)dout; unsigned int min_xfer; @@ -264,7 +263,7 @@ int spi_xfer(struct spi_slave *slave, const void *dout, in_rem = in_now; out_rem = out_now; - ret = do_xfer(slave, dout, &out_rem, din, &in_rem); + ret = do_xfer(regs, dout, &out_rem, din, &in_rem); if (ret < 0) break; -- cgit v1.2.3