lkml.org 
[lkml]   [2014]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Lattice ECP3 FPGA: Correct endianness
From
On Thu, Jul 3, 2014 at 5:54 PM, Jean-Michel Hautbois
<jean-michel.hautbois@vodalys.com> wrote:
> --- a/drivers/misc/lattice-ecp3-config.c
> +++ b/drivers/misc/lattice-ecp3-config.c
> @@ -93,7 +93,7 @@ static void firmware_load(const struct firmware *fw,
> void *context)
> txbuf[0] = FPGA_CMD_READ_ID;
> ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
> dev_dbg(&spi->dev, "FPGA JTAG ID=%08x\n", *(u32 *)&rxbuf[4]);
> - jedec_id = *(u32 *)&rxbuf[4];
> + jedec_id = be32_to_cpu(*(u32 *)&rxbuf[4]);

What about "jedec_id = get_unaligned_be32(&rxbuf[4]);" instead?

etc.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


\
 
 \ /
  Last update: 2014-07-04 17:41    [W:0.057 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site