summaryrefslogtreecommitdiff
path: root/drivers/media/mmc
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-09 11:34:56 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 07:46:18 -0300
commit80ccb51a0f970ab0935a8be70b677ecbcdf74e3e (patch)
treecd3edecad8522016a7de2545d34468c09dc511ab /drivers/media/mmc
parentfe802fd92d6abd1fce2ae8d03a073807d25e9453 (diff)
[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 <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/mmc')
-rw-r--r--drivers/media/mmc/siano/smssdio.c3
1 files changed, 3 insertions, 0 deletions
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);
}