diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index c21323e07d3c..027caa2eeb5c 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -891,7 +891,7 @@ static int aspeed_spi_user_unprepare_msg(struct spi_controller *ctlr, static void aspeed_spi_user_transfer_tx(struct aspeed_spi *aspi, struct spi_device *spi, const u8 *tx_buf, u8 *rx_buf, - void *dst, u32 len) + void __iomem *dst, u32 len) { const struct aspeed_spi_data *data = aspi->data; bool full_duplex_transfer = data->full_duplex && tx_buf == rx_buf; @@ -936,7 +936,7 @@ static int aspeed_spi_user_transfer(struct spi_controller *ctlr, aspeed_spi_set_io_mode(chip, CTRL_IO_QUAD_DATA); aspeed_spi_user_transfer_tx(aspi, spi, tx_buf, rx_buf, - (void *)ahb_base, xfer->len); + ahb_base, xfer->len); } if (rx_buf && rx_buf != tx_buf) { @@ -1467,8 +1467,7 @@ static int aspeed_spi_do_calibration(struct aspeed_spi_chip *chip) * must contains the highest number of consecutive "pass" * results and not span across multiple rows. */ -static u32 aspeed_spi_ast2600_optimized_timing(u32 rows, u32 cols, - u8 buf[rows][cols]) +static u32 aspeed_spi_ast2600_optimized_timing(u32 rows, u32 cols, u8 *buf) { int r = 0, c = 0; int max = 0; @@ -1478,7 +1477,7 @@ static u32 aspeed_spi_ast2600_optimized_timing(u32 rows, u32 cols, for (j = 0; j < cols;) { int k = j; - while (k < cols && buf[i][k]) + while (k < cols && buf[(i * cols) + k]) k++; if (k - j > max) { @@ -1541,7 +1540,7 @@ static int aspeed_spi_ast2600_calibrate(struct aspeed_spi_chip *chip, u32 hdiv, } } - calib_point = aspeed_spi_ast2600_optimized_timing(6, 17, calib_res); + calib_point = aspeed_spi_ast2600_optimized_timing(6, 17, &calib_res[0][0]); /* No good setting for this frequency */ if (calib_point == 0) return -1;