diff options
Diffstat (limited to 'drivers/media/dvb/siano/smscoreapi.c')
-rw-r--r-- | drivers/media/dvb/siano/smscoreapi.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index 5e8869a747f..e8267178c52 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c | |||
@@ -386,7 +386,7 @@ int smscore_register_device(smsdevice_params_t *params, | |||
386 | /* prepare dma buffers */ | 386 | /* prepare dma buffers */ |
387 | for (buffer = dev->common_buffer; | 387 | for (buffer = dev->common_buffer; |
388 | dev->num_buffers < params->num_buffers; | 388 | dev->num_buffers < params->num_buffers; |
389 | dev->num_buffers ++, buffer += params->buffer_size) { | 389 | dev->num_buffers++, buffer += params->buffer_size) { |
390 | smscore_buffer_t *cb = smscore_createbuffer(buffer, dev->common_buffer, dev->common_buffer_phys); | 390 | smscore_buffer_t *cb = smscore_createbuffer(buffer, dev->common_buffer, dev->common_buffer_phys); |
391 | if (!cb) { | 391 | if (!cb) { |
392 | smscore_unregister_device(dev); | 392 | smscore_unregister_device(dev); |
@@ -499,8 +499,7 @@ int smscore_load_firmware_family2(smscore_device_t *coredev, void *buffer, | |||
499 | mem_address = *(u32 *) &payload[20]; | 499 | mem_address = *(u32 *) &payload[20]; |
500 | } | 500 | } |
501 | 501 | ||
502 | while (size && rc >= 0) | 502 | while (size && rc >= 0) { |
503 | { | ||
504 | SmsDataDownload_ST *DataMsg = (SmsDataDownload_ST *) msg; | 503 | SmsDataDownload_ST *DataMsg = (SmsDataDownload_ST *) msg; |
505 | int payload_size = min((int) size, SMS_MAX_PAYLOAD_SIZE); | 504 | int payload_size = min((int) size, SMS_MAX_PAYLOAD_SIZE); |
506 | 505 | ||
@@ -530,11 +529,11 @@ int smscore_load_firmware_family2(smscore_device_t *coredev, void *buffer, | |||
530 | sizeof(SmsMsgHdr_ST) + | 529 | sizeof(SmsMsgHdr_ST) + |
531 | sizeof(u32) * 5); | 530 | sizeof(u32) * 5); |
532 | 531 | ||
533 | TriggerMsg->msgData[0] = firmware->StartAddress; // Entry point | 532 | TriggerMsg->msgData[0] = firmware->StartAddress; /* Entry point */ |
534 | TriggerMsg->msgData[1] = 5; // Priority | 533 | TriggerMsg->msgData[1] = 5; /* Priority */ |
535 | TriggerMsg->msgData[2] = 0x200; // Stack size | 534 | TriggerMsg->msgData[2] = 0x200; /* Stack size */ |
536 | TriggerMsg->msgData[3] = 0; // Parameter | 535 | TriggerMsg->msgData[3] = 0; /* Parameter */ |
537 | TriggerMsg->msgData[4] = 4; // Task ID | 536 | TriggerMsg->msgData[4] = 4; /* Task ID */ |
538 | 537 | ||
539 | if (coredev->device_flags & SMS_ROM_NO_RESPONSE) { | 538 | if (coredev->device_flags & SMS_ROM_NO_RESPONSE) { |
540 | rc = coredev->sendrequest_handler(coredev->context, TriggerMsg, TriggerMsg->xMsgHeader.msgLength); | 539 | rc = coredev->sendrequest_handler(coredev->context, TriggerMsg, TriggerMsg->xMsgHeader.msgLength); |
@@ -642,7 +641,7 @@ void smscore_unregister_device(smscore_device_t *coredev) | |||
642 | while (1) { | 641 | while (1) { |
643 | while ((cb = smscore_getbuffer(coredev))) { | 642 | while ((cb = smscore_getbuffer(coredev))) { |
644 | kfree(cb); | 643 | kfree(cb); |
645 | num_buffers ++; | 644 | num_buffers++; |
646 | } | 645 | } |
647 | if (num_buffers == coredev->num_buffers) | 646 | if (num_buffers == coredev->num_buffers) |
648 | break; | 647 | break; |
@@ -842,14 +841,14 @@ smscore_client_t *smscore_find_client(smscore_device_t *coredev, int data_type, | |||
842 | for (next = first->next; | 841 | for (next = first->next; |
843 | (next != first) && !client; | 842 | (next != first) && !client; |
844 | next = next->next) { | 843 | next = next->next) { |
845 | firstid = &((smscore_client_t*)next)->idlist; | 844 | firstid = &((smscore_client_t *)next)->idlist; |
846 | for (nextid = firstid->next; | 845 | for (nextid = firstid->next; |
847 | nextid != firstid; | 846 | nextid != firstid; |
848 | nextid = nextid->next) { | 847 | nextid = nextid->next) { |
849 | if ((((smscore_idlist_t*)nextid)->id == id) && | 848 | if ((((smscore_idlist_t *)nextid)->id == id) && |
850 | (((smscore_idlist_t*)nextid)->data_type == data_type || | 849 | (((smscore_idlist_t *)nextid)->data_type == data_type || |
851 | (((smscore_idlist_t*)nextid)->data_type == 0))) { | 850 | (((smscore_idlist_t *)nextid)->data_type == 0))) { |
852 | client = (smscore_client_t*) next; | 851 | client = (smscore_client_t *) next; |
853 | break; | 852 | break; |
854 | } | 853 | } |
855 | } | 854 | } |
@@ -880,8 +879,7 @@ void smscore_onresponse(smscore_device_t *coredev, smscore_buffer_t *cb) | |||
880 | if (!last_sample_time) | 879 | if (!last_sample_time) |
881 | last_sample_time = time_now; | 880 | last_sample_time = time_now; |
882 | 881 | ||
883 | if (time_now - last_sample_time > 10000) | 882 | if (time_now - last_sample_time > 10000) { |
884 | { | ||
885 | printk("\n%s data rate %d bytes/secs\n", __func__, | 883 | printk("\n%s data rate %d bytes/secs\n", __func__, |
886 | (int)((data_total * 1000) / | 884 | (int)((data_total * 1000) / |
887 | (time_now - last_sample_time))); | 885 | (time_now - last_sample_time))); |
@@ -989,9 +987,9 @@ int smscore_validate_client(smscore_device_t *coredev, | |||
989 | return -EFAULT; | 987 | return -EFAULT; |
990 | } | 988 | } |
991 | registered_client = smscore_find_client(coredev, data_type, id); | 989 | registered_client = smscore_find_client(coredev, data_type, id); |
992 | if (registered_client == client) { | 990 | if (registered_client == client) |
993 | return 0; | 991 | return 0; |
994 | } | 992 | |
995 | if (registered_client) { | 993 | if (registered_client) { |
996 | PERROR("The msg ID already registered to another client.\n"); | 994 | PERROR("The msg ID already registered to another client.\n"); |
997 | return -EEXIST; | 995 | return -EEXIST; |
@@ -1069,7 +1067,7 @@ void smscore_unregister_client(smscore_client_t *client) | |||
1069 | 1067 | ||
1070 | while (!list_empty(&client->idlist)) { | 1068 | while (!list_empty(&client->idlist)) { |
1071 | smscore_idlist_t *identry = | 1069 | smscore_idlist_t *identry = |
1072 | (smscore_idlist_t*) client->idlist.next; | 1070 | (smscore_idlist_t *) client->idlist.next; |
1073 | list_del(&identry->entry); | 1071 | list_del(&identry->entry); |
1074 | kfree(identry); | 1072 | kfree(identry); |
1075 | } | 1073 | } |