From 80ccb51a0f970ab0935a8be70b677ecbcdf74e3e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 9 Mar 2013 11:34:56 -0300 Subject: [media] siano: simplify message endianness logic Currently, every time a message is sent or received, the endiannes need to be fixed on big endian machines. This is currently done on every call to the send API, and on every msg reception logic. Instead of doing that, move it to the send/receive functions. That simplifies the logic and avoids the risk of forgetting to fix it somewhere. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/mmc/siano/smssdio.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media/mmc') diff --git a/drivers/media/mmc/siano/smssdio.c b/drivers/media/mmc/siano/smssdio.c index c96da47bece5..8834c435acae 100644 --- a/drivers/media/mmc/siano/smssdio.c +++ b/drivers/media/mmc/siano/smssdio.c @@ -43,6 +43,7 @@ #include "smscoreapi.h" #include "sms-cards.h" +#include "smsendian.h" /* Registers */ @@ -97,6 +98,7 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size) sdio_claim_host(smsdev->func); + smsendian_handle_tx_message((struct SmsMsgData_ST *) buffer); while (size >= smsdev->func->cur_blksize) { ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA, buffer, smsdev->func->cur_blksize); @@ -231,6 +233,7 @@ static void smssdio_interrupt(struct sdio_func *func) cb->size = hdr->msgLength; cb->offset = 0; + smsendian_handle_rx_message((struct SmsMsgData_ST *) cb->p); smscore_onresponse(smsdev->coredev, cb); } -- cgit v1.2.3