summaryrefslogtreecommitdiff
path: root/src/soc/rockchip/common
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-04-09 13:04:54 -0700
committerPatrick Georgi <pgeorgi@google.com>2016-04-13 23:39:16 +0200
commitfbec1ad4efbdd01759cd4d2e22d27281bd5b1626 (patch)
tree577a6665b9182a4bc0af2ae14ba1b8e5c05186b2 /src/soc/rockchip/common
parent6d6b129ea43ba847ba50efa249fbad3a4ad745bc (diff)
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 <pgeorgi@chromium.org> Original-Commit-Id: a2b42779785623bd1234ab2dfb0b4db76c890fc7 Original-Change-Id: I9d657dc23540e9eac52d2dbfc551ed32b7fa98f0 Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/338090 Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/14318 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/rockchip/common')
-rw-r--r--src/soc/rockchip/common/spi.c7
1 files changed, 3 insertions, 4 deletions
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;