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>
This commit is contained in:
Vadim Bendebury 2016-04-09 13:04:54 -07:00 committed by Patrick Georgi
parent 6d6b129ea4
commit fbec1ad4ef
1 changed files with 3 additions and 4 deletions

View File

@ -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,
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;