aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/mmc
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-09 09:34:56 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 06:46:18 -0400
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 @@
43 43
44#include "smscoreapi.h" 44#include "smscoreapi.h"
45#include "sms-cards.h" 45#include "sms-cards.h"
46#include "smsendian.h"
46 47
47/* Registers */ 48/* Registers */
48 49
@@ -97,6 +98,7 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size)
97 98
98 sdio_claim_host(smsdev->func); 99 sdio_claim_host(smsdev->func);
99 100
101 smsendian_handle_tx_message((struct SmsMsgData_ST *) buffer);
100 while (size >= smsdev->func->cur_blksize) { 102 while (size >= smsdev->func->cur_blksize) {
101 ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA, 103 ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA,
102 buffer, smsdev->func->cur_blksize); 104 buffer, smsdev->func->cur_blksize);
@@ -231,6 +233,7 @@ static void smssdio_interrupt(struct sdio_func *func)
231 cb->size = hdr->msgLength; 233 cb->size = hdr->msgLength;
232 cb->offset = 0; 234 cb->offset = 0;
233 235
236 smsendian_handle_rx_message((struct SmsMsgData_ST *) cb->p);
234 smscore_onresponse(smsdev->coredev, cb); 237 smscore_onresponse(smsdev->coredev, cb);
235} 238}
236 239