Skip to content

Commit f3a59ab

Browse files
hardevsinh-1broonie
authored andcommitted
spi: spi-imx: Fix casting warnings
Sparse warnings: drivers/spi/spi-imx.c:410:19: warning: cast to restricted __be32 drivers/spi/spi-imx.c:410:19: warning: cast to restricted __be32 drivers/spi/spi-imx.c:410:19: warning: cast to restricted __be32 drivers/spi/spi-imx.c:410:19: warning: cast to restricted __be32 drivers/spi/spi-imx.c:410:19: warning: cast to restricted __be32 drivers/spi/spi-imx.c:410:19: warning: cast to restricted __be32 drivers/spi/spi-imx.c:439:21: warning: incorrect type in assignment (different base types) drivers/spi/spi-imx.c:439:21: expected unsigned int [addressable] [usertype] val drivers/spi/spi-imx.c:439:21: got restricted __be32 [usertype] Signed-off-by: Hardevsinh Palaniya <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 66c1c41 commit f3a59ab

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/spi/spi-imx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static void spi_imx_buf_tx_swap(struct spi_imx_data *spi_imx)
407407

408408
static void mx53_ecspi_rx_target(struct spi_imx_data *spi_imx)
409409
{
410-
u32 val = be32_to_cpu(readl(spi_imx->base + MXC_CSPIRXDATA));
410+
u32 val = ioread32be(spi_imx->base + MXC_CSPIRXDATA);
411411

412412
if (spi_imx->rx_buf) {
413413
int n_bytes = spi_imx->target_burst % sizeof(val);
@@ -436,13 +436,12 @@ static void mx53_ecspi_tx_target(struct spi_imx_data *spi_imx)
436436
if (spi_imx->tx_buf) {
437437
memcpy(((u8 *)&val) + sizeof(val) - n_bytes,
438438
spi_imx->tx_buf, n_bytes);
439-
val = cpu_to_be32(val);
440439
spi_imx->tx_buf += n_bytes;
441440
}
442441

443442
spi_imx->count -= n_bytes;
444443

445-
writel(val, spi_imx->base + MXC_CSPITXDATA);
444+
iowrite32be(val, spi_imx->base + MXC_CSPITXDATA);
446445
}
447446

448447
/* MX51 eCSPI */

0 commit comments

Comments
 (0)