@@ -93,9 +93,9 @@ static void hdlc_rx_greybus_frame(struct gb_beagleplay *bg, u8 *buf, u16 len)
93
93
memcpy (& cport_id , hdr -> pad , sizeof (cport_id ));
94
94
95
95
dev_dbg (& bg -> sd -> dev , "Greybus Operation %u type %X cport %u status %u received" ,
96
- hdr -> operation_id , hdr -> type , cport_id , hdr -> result );
96
+ hdr -> operation_id , hdr -> type , le16_to_cpu ( cport_id ) , hdr -> result );
97
97
98
- greybus_data_rcvd (bg -> gb_hd , cport_id , buf , len );
98
+ greybus_data_rcvd (bg -> gb_hd , le16_to_cpu ( cport_id ) , buf , len );
99
99
}
100
100
101
101
static void hdlc_rx_dbg_frame (const struct gb_beagleplay * bg , const char * buf , u16 len )
@@ -340,14 +340,15 @@ static int gb_message_send(struct gb_host_device *hd, u16 cport, struct gb_messa
340
340
{
341
341
struct gb_beagleplay * bg = dev_get_drvdata (& hd -> dev );
342
342
struct hdlc_payload payloads [2 ];
343
+ __le16 cport_id = le16_to_cpu (cport );
343
344
344
345
dev_dbg (& hd -> dev , "Sending greybus message with Operation %u, Type: %X on Cport %u" ,
345
346
msg -> header -> operation_id , msg -> header -> type , cport );
346
347
347
- if (msg -> header -> size > RX_HDLC_PAYLOAD )
348
+ if (le16_to_cpu ( msg -> header -> size ) > RX_HDLC_PAYLOAD )
348
349
return dev_err_probe (& hd -> dev , - E2BIG , "Greybus message too big" );
349
350
350
- memcpy (msg -> header -> pad , & cport , sizeof (cport ));
351
+ memcpy (msg -> header -> pad , & cport_id , sizeof (cport_id ));
351
352
352
353
payloads [0 ].buf = msg -> header ;
353
354
payloads [0 ].len = sizeof (* msg -> header );
0 commit comments