This patch typecasts and accesses rx buf properly as
an unaligned rxbuf, typecasting with u16 and accessing
it causes data abort exception and this patch fixes it.
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/20220131052240.23403-2-ashok.reddy.soma@xilinx.com
priv->rx_buf += 1;
break;
case 2:
- *((u16 *)priv->rx_buf) = data;
- priv->rx_buf += 2;
+ *((u8 *)priv->rx_buf) = data;
+ priv->rx_buf += 1;
+ *((u8 *)priv->rx_buf) = (u8)(data >> 8);
+ priv->rx_buf += 1;
break;
case 3:
- *((u16 *)priv->rx_buf) = data;
- priv->rx_buf += 2;
+ *((u8 *)priv->rx_buf) = data;
+ priv->rx_buf += 1;
+ *((u8 *)priv->rx_buf) = (u8)(data >> 8);
+ priv->rx_buf += 1;
byte3 = (u8)(data >> 16);
*((u8 *)priv->rx_buf) = byte3;
priv->rx_buf += 1;