[coreboot-gerrit] New patch to review for coreboot: rockchip/common: do not retrieve register pointer twice
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Mon Apr 11 21:32:47 CEST 2016
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14318
-gerrit
commit 674ff260e145cc6d22ea98d117ed25de41d9b247
Author: Vadim Bendebury <vbendeb at chromium.org>
Date: Sat Apr 9 13:04:54 2016 -0700
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 at chromium.org>
Original-Commit-Id: a2b42779785623bd1234ab2dfb0b4db76c890fc7
Original-Change-Id: I9d657dc23540e9eac52d2dbfc551ed32b7fa98f0
Original-Signed-off-by: Vadim Bendebury <vbendeb at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/338090
Original-Reviewed-by: Patrick Georgi <pgeorgi at chromium.org>
---
src/soc/rockchip/common/spi.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/soc/rockchip/common/spi.c b/src/soc/rockchip/common/spi.c
index b08509f..814f0b5 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;
More information about the coreboot-gerrit
mailing list