aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-06-19 19:35:21 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:22:37 -0400
commita0c0abcb1fdb316dee3a38cff9843d7d094c327c (patch)
tree6f6284afd5940e43df2b8004b3bed789fef09ba6 /drivers/media
parent068d6c0f5d6c67d0e93f8e214897ddd64746be4e (diff)
V4L/DVB (8294): sms1xxx: move message formatting into printk macros
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/siano/smscoreapi.c142
-rw-r--r--drivers/media/dvb/siano/smscoreapi.h9
-rw-r--r--drivers/media/dvb/siano/smsdvb.c35
-rw-r--r--drivers/media/dvb/siano/smsusb.c90
4 files changed, 125 insertions, 151 deletions
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c
index a35513ef74a9..6e2cc3d57161 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -157,8 +157,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath)
157 strcpy(entry->devpath, devpath); 157 strcpy(entry->devpath, devpath);
158 list_add(&entry->entry, &g_smscore_registry); 158 list_add(&entry->entry, &g_smscore_registry);
159 } else 159 } else
160 sms_err("%s failed to create smscore_registry.\n", 160 sms_err("failed to create smscore_registry.");
161 __func__);
162 kmutex_unlock(&g_smscore_registrylock); 161 kmutex_unlock(&g_smscore_registrylock);
163 return entry; 162 return entry;
164} 163}
@@ -171,7 +170,7 @@ int smscore_registry_getmode(char *devpath)
171 if (entry) 170 if (entry)
172 return entry->mode; 171 return entry->mode;
173 else 172 else
174 sms_err("%s No registry found.\n", __func__); 173 sms_err("No registry found.");
175 174
176 return default_mode; 175 return default_mode;
177} 176}
@@ -184,7 +183,7 @@ enum sms_device_type_st smscore_registry_gettype(char *devpath)
184 if (entry) 183 if (entry)
185 return entry->type; 184 return entry->type;
186 else 185 else
187 sms_err("%s No registry found.\n", __func__); 186 sms_err("No registry found.");
188 187
189 return -1; 188 return -1;
190} 189}
@@ -197,7 +196,7 @@ void smscore_registry_setmode(char *devpath, int mode)
197 if (entry) 196 if (entry)
198 entry->mode = mode; 197 entry->mode = mode;
199 else 198 else
200 sms_err("%s No registry found.\n", __func__); 199 sms_err("No registry found.");
201} 200}
202 201
203void smscore_registry_settype(char *devpath, enum sms_device_type_st type) 202void smscore_registry_settype(char *devpath, enum sms_device_type_st type)
@@ -208,7 +207,7 @@ void smscore_registry_settype(char *devpath, enum sms_device_type_st type)
208 if (entry) 207 if (entry)
209 entry->type = type; 208 entry->type = type;
210 else 209 else
211 sms_err("%s No registry found.\n", __func__); 210 sms_err("No registry found.");
212} 211}
213 212
214 213
@@ -331,7 +330,7 @@ struct smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer,
331 struct smscore_buffer_t *cb = 330 struct smscore_buffer_t *cb =
332 kmalloc(sizeof(struct smscore_buffer_t), GFP_KERNEL); 331 kmalloc(sizeof(struct smscore_buffer_t), GFP_KERNEL);
333 if (!cb) { 332 if (!cb) {
334 sms_info("%s kmalloc(...) failed\n", __func__); 333 sms_info("kmalloc(...) failed");
335 return NULL; 334 return NULL;
336 } 335 }
337 336
@@ -360,7 +359,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
360 359
361 dev = kzalloc(sizeof(struct smscore_device_t), GFP_KERNEL); 360 dev = kzalloc(sizeof(struct smscore_device_t), GFP_KERNEL);
362 if (!dev) { 361 if (!dev) {
363 sms_info("%s kzalloc(...) failed\n", __func__); 362 sms_info("kzalloc(...) failed");
364 return -ENOMEM; 363 return -ENOMEM;
365 } 364 }
366 365
@@ -408,8 +407,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
408 smscore_putbuffer(dev, cb); 407 smscore_putbuffer(dev, cb);
409 } 408 }
410 409
411 sms_info("%s allocated %d buffers\n", 410 sms_info("allocated %d buffers", dev->num_buffers);
412 __func__, dev->num_buffers);
413 411
414 dev->mode = DEVICE_MODE_NONE; 412 dev->mode = DEVICE_MODE_NONE;
415 dev->context = params->context; 413 dev->context = params->context;
@@ -432,7 +430,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
432 430
433 *coredev = dev; 431 *coredev = dev;
434 432
435 sms_info("%s device %p created\n", __func__, dev); 433 sms_info("device %p created", dev);
436 434
437 return 0; 435 return 0;
438} 436}
@@ -450,8 +448,7 @@ int smscore_start_device(struct smscore_device_t *coredev)
450 int rc = smscore_set_device_mode( 448 int rc = smscore_set_device_mode(
451 coredev, smscore_registry_getmode(coredev->devpath)); 449 coredev, smscore_registry_getmode(coredev->devpath));
452 if (rc < 0) { 450 if (rc < 0) {
453 sms_info("%s set device mode faile , rc %d\n", 451 sms_info("set device mode faile , rc %d", rc);
454 __func__, rc);
455 return rc; 452 return rc;
456 } 453 }
457 454
@@ -459,8 +456,7 @@ int smscore_start_device(struct smscore_device_t *coredev)
459 456
460 rc = smscore_notify_callbacks(coredev, coredev->device, 1); 457 rc = smscore_notify_callbacks(coredev, coredev->device, 1);
461 458
462 sms_info("%s device %p started, rc %d\n", 459 sms_info("device %p started, rc %d", coredev, rc);
463 __func__, coredev, rc);
464 460
465 kmutex_unlock(&g_smscore_deviceslock); 461 kmutex_unlock(&g_smscore_deviceslock);
466 462
@@ -472,8 +468,7 @@ int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, void *buffer,
472{ 468{
473 int rc = coredev->sendrequest_handler(coredev->context, buffer, size); 469 int rc = coredev->sendrequest_handler(coredev->context, buffer, size);
474 if (rc < 0) { 470 if (rc < 0) {
475 sms_info("%s sendrequest returned error %d\n", 471 sms_info("sendrequest returned error %d", rc);
476 __func__, rc);
477 return rc; 472 return rc;
478 } 473 }
479 474
@@ -491,8 +486,8 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev,
491 u8 *payload = firmware->Payload; 486 u8 *payload = firmware->Payload;
492 int rc = 0; 487 int rc = 0;
493 488
494 sms_info("%s loading FW to addr 0x%x size %d\n", 489 sms_info("loading FW to addr 0x%x size %d",
495 __func__, mem_address, firmware->Length); 490 mem_address, firmware->Length);
496 if (coredev->preload_handler) { 491 if (coredev->preload_handler) {
497 rc = coredev->preload_handler(coredev->context); 492 rc = coredev->preload_handler(coredev->context);
498 if (rc < 0) 493 if (rc < 0)
@@ -505,7 +500,7 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev,
505 return -ENOMEM; 500 return -ENOMEM;
506 501
507 if (coredev->mode != DEVICE_MODE_NONE) { 502 if (coredev->mode != DEVICE_MODE_NONE) {
508 PDEBUG("Sending reload command\n"); 503 PDEBUG("Sending reload command");
509 SMS_INIT_MSG(msg, MSG_SW_RELOAD_START_REQ, 504 SMS_INIT_MSG(msg, MSG_SW_RELOAD_START_REQ,
510 sizeof(struct SmsMsgHdr_ST)); 505 sizeof(struct SmsMsgHdr_ST));
511 rc = smscore_sendrequest_and_wait(coredev, msg, 506 rc = smscore_sendrequest_and_wait(coredev, msg,
@@ -578,7 +573,7 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev,
578 msleep(500); 573 msleep(500);
579 } 574 }
580 575
581 sms_debug("%s rc=%d, postload=%p \n", __func__, rc, 576 sms_debug("rc=%d, postload=%p ", rc,
582 coredev->postload_handler); 577 coredev->postload_handler);
583 578
584 kfree(msg); 579 kfree(msg);
@@ -612,12 +607,10 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
612 607
613 rc = request_firmware(&fw, filename, coredev->device); 608 rc = request_firmware(&fw, filename, coredev->device);
614 if (rc < 0) { 609 if (rc < 0) {
615 sms_info("%s failed to open \"%s\"\n", 610 sms_info("failed to open \"%s\"", filename);
616 __func__, filename);
617 return rc; 611 return rc;
618 } 612 }
619 sms_info("%s read FW %s, size=%d\"\n", __func__, 613 sms_info("read FW %s, size=%d\"", filename, fw->size);
620 filename, fw->size);
621 fw_buffer = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT), 614 fw_buffer = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT),
622 GFP_KERNEL | GFP_DMA); 615 GFP_KERNEL | GFP_DMA);
623 if (fw_buffer) { 616 if (fw_buffer) {
@@ -632,8 +625,7 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
632 625
633 kfree(fw_buffer); 626 kfree(fw_buffer);
634 } else { 627 } else {
635 sms_info("%s failed to allocate firmware buffer\n", 628 sms_info("failed to allocate firmware buffer");
636 __func__);
637 rc = -ENOMEM; 629 rc = -ENOMEM;
638 } 630 }
639 631
@@ -645,7 +637,7 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
645int smscore_load_firmware_from_buffer(struct smscore_device_t *coredev, 637int smscore_load_firmware_from_buffer(struct smscore_device_t *coredev,
646 u8 *buffer, int size, int new_mode) 638 u8 *buffer, int size, int new_mode)
647{ 639{
648 PERROR("Feature not implemented yet\n"); 640 PERROR("Feature not implemented yet");
649 return -EFAULT; 641 return -EFAULT;
650} 642}
651 643
@@ -680,17 +672,17 @@ void smscore_unregister_device(struct smscore_device_t *coredev)
680 if (num_buffers == coredev->num_buffers) 672 if (num_buffers == coredev->num_buffers)
681 break; 673 break;
682 if (++retry > 10) { 674 if (++retry > 10) {
683 sms_info("%s exiting although " 675 sms_info("exiting although "
684 "not all buffers released.\n", __func__); 676 "not all buffers released.");
685 break; 677 break;
686 } 678 }
687 679
688 sms_info("%s waiting for %d buffer(s)\n", __func__, 680 sms_info("waiting for %d buffer(s)",
689 coredev->num_buffers - num_buffers); 681 coredev->num_buffers - num_buffers);
690 msleep(100); 682 msleep(100);
691 } 683 }
692 684
693 sms_info("%s freed %d buffers\n", __func__, num_buffers); 685 sms_info("freed %d buffers", num_buffers);
694 686
695 if (coredev->common_buffer) 687 if (coredev->common_buffer)
696 dma_free_coherent(NULL, coredev->common_buffer_size, 688 dma_free_coherent(NULL, coredev->common_buffer_size,
@@ -702,7 +694,7 @@ void smscore_unregister_device(struct smscore_device_t *coredev)
702 694
703 kmutex_unlock(&g_smscore_deviceslock); 695 kmutex_unlock(&g_smscore_deviceslock);
704 696
705 sms_info("%s device %p destroyed\n", __func__, coredev); 697 sms_info("device %p destroyed", coredev);
706} 698}
707 699
708int smscore_detect_mode(struct smscore_device_t *coredev) 700int smscore_detect_mode(struct smscore_device_t *coredev)
@@ -722,8 +714,7 @@ int smscore_detect_mode(struct smscore_device_t *coredev)
722 rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength, 714 rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength,
723 &coredev->version_ex_done); 715 &coredev->version_ex_done);
724 if (rc == -ETIME) { 716 if (rc == -ETIME) {
725 sms_err("%s: MSG_SMS_GET_VERSION_EX_REQ " 717 sms_err("MSG_SMS_GET_VERSION_EX_REQ failed first try");
726 "failed first try\n", __func__);
727 718
728 if (wait_for_completion_timeout(&coredev->resume_done, 719 if (wait_for_completion_timeout(&coredev->resume_done,
729 msecs_to_jiffies(5000))) { 720 msecs_to_jiffies(5000))) {
@@ -731,9 +722,8 @@ int smscore_detect_mode(struct smscore_device_t *coredev)
731 coredev, msg, msg->msgLength, 722 coredev, msg, msg->msgLength,
732 &coredev->version_ex_done); 723 &coredev->version_ex_done);
733 if (rc < 0) 724 if (rc < 0)
734 sms_err("%s: " 725 sms_err("MSG_SMS_GET_VERSION_EX_REQ failed "
735 "MSG_SMS_GET_VERSION_EX_REQ failed " 726 "second try, rc %d", rc);
736 "second try, rc %d\n", __func__, rc);
737 } else 727 } else
738 rc = -ETIME; 728 rc = -ETIME;
739 } 729 }
@@ -780,11 +770,10 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
780 int rc = 0; 770 int rc = 0;
781 enum sms_device_type_st type; 771 enum sms_device_type_st type;
782 772
783 PDEBUG("set device mode to %d\n", mode); 773 PDEBUG("set device mode to %d", mode);
784 if (coredev->device_flags & SMS_DEVICE_FAMILY2) { 774 if (coredev->device_flags & SMS_DEVICE_FAMILY2) {
785 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_RAW_TUNER) { 775 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_RAW_TUNER) {
786 sms_info("%s invalid mode specified %d\n", 776 sms_info("invalid mode specified %d", mode);
787 __func__, mode);
788 return -EINVAL; 777 return -EINVAL;
789 } 778 }
790 779
@@ -793,15 +782,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
793 if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) { 782 if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) {
794 rc = smscore_detect_mode(coredev); 783 rc = smscore_detect_mode(coredev);
795 if (rc < 0) { 784 if (rc < 0) {
796 sms_info("%s mode detect failed %d\n", 785 sms_info("mode detect failed %d", rc);
797 __func__, rc);
798 return rc; 786 return rc;
799 } 787 }
800 } 788 }
801 789
802 if (coredev->mode == mode) { 790 if (coredev->mode == mode) {
803 sms_info("%s device mode %d already set\n", 791 sms_info("device mode %d already set", mode);
804 __func__, mode);
805 return 0; 792 return 0;
806 } 793 }
807 794
@@ -810,13 +797,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
810 rc = smscore_load_firmware_from_file( 797 rc = smscore_load_firmware_from_file(
811 coredev, smscore_fw_lkup[mode][type], NULL); 798 coredev, smscore_fw_lkup[mode][type], NULL);
812 if (rc < 0) { 799 if (rc < 0) {
813 sms_info("%s load firmware " 800 sms_info("load firmware "
814 "failed %d\n", __func__, rc); 801 "failed %d", rc);
815 return rc; 802 return rc;
816 } 803 }
817 } else 804 } else
818 sms_info("%s mode %d supported by running " 805 sms_info("mode %d supported by running "
819 "firmware\n", __func__, mode); 806 "firmware", mode);
820 807
821 buffer = kmalloc(sizeof(struct SmsMsgData_ST) + 808 buffer = kmalloc(sizeof(struct SmsMsgData_ST) +
822 SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); 809 SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA);
@@ -835,14 +822,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
835 822
836 kfree(buffer); 823 kfree(buffer);
837 } else { 824 } else {
838 sms_info("%s Could not allocate buffer for " 825 sms_info("Could not allocate buffer for "
839 "init device message.\n", __func__); 826 "init device message.");
840 rc = -ENOMEM; 827 rc = -ENOMEM;
841 } 828 }
842 } else { 829 } else {
843 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { 830 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
844 sms_info("%s invalid mode specified %d\n", 831 sms_info("invalid mode specified %d", mode);
845 __func__, mode);
846 return -EINVAL; 832 return -EINVAL;
847 } 833 }
848 834
@@ -862,7 +848,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
862 } 848 }
863 849
864 if (rc != 0) 850 if (rc != 0)
865 sms_info("%s return error code %d.\n", __func__, rc); 851 sms_info("return error code %d.", rc);
866 return rc; 852 return rc;
867} 853}
868 854
@@ -945,7 +931,7 @@ void smscore_onresponse(struct smscore_device_t *coredev,
945 last_sample_time = time_now; 931 last_sample_time = time_now;
946 932
947 if (time_now - last_sample_time > 10000) { 933 if (time_now - last_sample_time > 10000) {
948 sms_debug("\n%s data rate %d bytes/secs\n", __func__, 934 sms_debug("\ndata rate %d bytes/secs",
949 (int)((data_total * 1000) / 935 (int)((data_total * 1000) /
950 (time_now - last_sample_time))); 936 (time_now - last_sample_time)));
951 937
@@ -965,8 +951,8 @@ void smscore_onresponse(struct smscore_device_t *coredev,
965 { 951 {
966 struct SmsVersionRes_ST *ver = 952 struct SmsVersionRes_ST *ver =
967 (struct SmsVersionRes_ST *) phdr; 953 (struct SmsVersionRes_ST *) phdr;
968 sms_debug("%s: MSG_SMS_GET_VERSION_EX_RES " 954 sms_debug("MSG_SMS_GET_VERSION_EX_RES "
969 "id %d prots 0x%x ver %d.%d\n", __func__, 955 "id %d prots 0x%x ver %d.%d",
970 ver->FirmwareId, ver->SupportedProtocols, 956 ver->FirmwareId, ver->SupportedProtocols,
971 ver->RomVersionMajor, ver->RomVersionMinor); 957 ver->RomVersionMajor, ver->RomVersionMinor);
972 958
@@ -978,25 +964,21 @@ void smscore_onresponse(struct smscore_device_t *coredev,
978 break; 964 break;
979 } 965 }
980 case MSG_SMS_INIT_DEVICE_RES: 966 case MSG_SMS_INIT_DEVICE_RES:
981 sms_debug("%s: MSG_SMS_INIT_DEVICE_RES\n", 967 sms_debug("MSG_SMS_INIT_DEVICE_RES");
982 __func__);
983 complete(&coredev->init_device_done); 968 complete(&coredev->init_device_done);
984 break; 969 break;
985 case MSG_SW_RELOAD_START_RES: 970 case MSG_SW_RELOAD_START_RES:
986 sms_debug("%s: MSG_SW_RELOAD_START_RES\n", 971 sms_debug("MSG_SW_RELOAD_START_RES");
987 __func__);
988 complete(&coredev->reload_start_done); 972 complete(&coredev->reload_start_done);
989 break; 973 break;
990 case MSG_SMS_DATA_DOWNLOAD_RES: 974 case MSG_SMS_DATA_DOWNLOAD_RES:
991 complete(&coredev->data_download_done); 975 complete(&coredev->data_download_done);
992 break; 976 break;
993 case MSG_SW_RELOAD_EXEC_RES: 977 case MSG_SW_RELOAD_EXEC_RES:
994 sms_debug("%s: MSG_SW_RELOAD_EXEC_RES\n", 978 sms_debug("MSG_SW_RELOAD_EXEC_RES");
995 __func__);
996 break; 979 break;
997 case MSG_SMS_SWDOWNLOAD_TRIGGER_RES: 980 case MSG_SMS_SWDOWNLOAD_TRIGGER_RES:
998 sms_debug("%s: MSG_SMS_SWDOWNLOAD_TRIGGER_RES\n", 981 sms_debug("MSG_SMS_SWDOWNLOAD_TRIGGER_RES");
999 __func__);
1000 complete(&coredev->trigger_done); 982 complete(&coredev->trigger_done);
1001 break; 983 break;
1002 case MSG_SMS_SLEEP_RESUME_COMP_IND: 984 case MSG_SMS_SLEEP_RESUME_COMP_IND:
@@ -1056,7 +1038,7 @@ int smscore_validate_client(struct smscore_device_t *coredev,
1056 struct smscore_client_t *registered_client; 1038 struct smscore_client_t *registered_client;
1057 1039
1058 if (!client) { 1040 if (!client) {
1059 PERROR("bad parameter.\n"); 1041 PERROR("bad parameter.");
1060 return -EFAULT; 1042 return -EFAULT;
1061 } 1043 }
1062 registered_client = smscore_find_client(coredev, data_type, id); 1044 registered_client = smscore_find_client(coredev, data_type, id);
@@ -1064,12 +1046,12 @@ int smscore_validate_client(struct smscore_device_t *coredev,
1064 return 0; 1046 return 0;
1065 1047
1066 if (registered_client) { 1048 if (registered_client) {
1067 PERROR("The msg ID already registered to another client.\n"); 1049 PERROR("The msg ID already registered to another client.");
1068 return -EEXIST; 1050 return -EEXIST;
1069 } 1051 }
1070 listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); 1052 listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL);
1071 if (!listentry) { 1053 if (!listentry) {
1072 PERROR("Can't allocate memory for client id.\n"); 1054 PERROR("Can't allocate memory for client id.");
1073 return -ENOMEM; 1055 return -ENOMEM;
1074 } 1056 }
1075 listentry->id = id; 1057 listentry->id = id;
@@ -1101,13 +1083,13 @@ int smscore_register_client(struct smscore_device_t *coredev,
1101 /* check that no other channel with same parameters exists */ 1083 /* check that no other channel with same parameters exists */
1102 if (smscore_find_client(coredev, params->data_type, 1084 if (smscore_find_client(coredev, params->data_type,
1103 params->initial_id)) { 1085 params->initial_id)) {
1104 PERROR("Client already exist.\n"); 1086 PERROR("Client already exist.");
1105 return -EEXIST; 1087 return -EEXIST;
1106 } 1088 }
1107 1089
1108 newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); 1090 newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL);
1109 if (!newclient) { 1091 if (!newclient) {
1110 PERROR("Failed to allocate memory for client.\n"); 1092 PERROR("Failed to allocate memory for client.");
1111 return -ENOMEM; 1093 return -ENOMEM;
1112 } 1094 }
1113 1095
@@ -1121,7 +1103,7 @@ int smscore_register_client(struct smscore_device_t *coredev,
1121 smscore_validate_client(coredev, newclient, params->data_type, 1103 smscore_validate_client(coredev, newclient, params->data_type,
1122 params->initial_id); 1104 params->initial_id);
1123 *client = newclient; 1105 *client = newclient;
1124 PDEBUG("%p %d %d\n", params->context, params->data_type, 1106 PDEBUG("%p %d %d", params->context, params->data_type,
1125 params->initial_id); 1107 params->initial_id);
1126 1108
1127 return 0; 1109 return 0;
@@ -1149,7 +1131,7 @@ void smscore_unregister_client(struct smscore_client_t *client)
1149 kfree(identry); 1131 kfree(identry);
1150 } 1132 }
1151 1133
1152 sms_info("%s %p\n", __func__, client->context); 1134 sms_info("%p", client->context);
1153 1135
1154 list_del(&client->entry); 1136 list_del(&client->entry);
1155 kfree(client); 1137 kfree(client);
@@ -1176,7 +1158,7 @@ int smsclient_sendrequest(struct smscore_client_t *client,
1176 int rc; 1158 int rc;
1177 1159
1178 if (client == NULL) { 1160 if (client == NULL) {
1179 sms_err("%s Got NULL client\n", __func__); 1161 sms_err("Got NULL client");
1180 return -EINVAL; 1162 return -EINVAL;
1181 } 1163 }
1182 1164
@@ -1184,7 +1166,7 @@ int smsclient_sendrequest(struct smscore_client_t *client,
1184 1166
1185 /* check that no other channel with same id exists */ 1167 /* check that no other channel with same id exists */
1186 if (coredev == NULL) { 1168 if (coredev == NULL) {
1187 sms_err("%s Got NULL coredev\n", __func__); 1169 sms_err("Got NULL coredev");
1188 return -EINVAL; 1170 return -EINVAL;
1189 } 1171 }
1190 1172
@@ -1225,20 +1207,20 @@ int smscore_map_common_buffer(struct smscore_device_t *coredev,
1225 1207
1226 if (!(vma->vm_flags & (VM_READ | VM_SHARED)) || 1208 if (!(vma->vm_flags & (VM_READ | VM_SHARED)) ||
1227 (vma->vm_flags & VM_WRITE)) { 1209 (vma->vm_flags & VM_WRITE)) {
1228 sms_info("%s invalid vm flags\n", __func__); 1210 sms_info("invalid vm flags");
1229 return -EINVAL; 1211 return -EINVAL;
1230 } 1212 }
1231 1213
1232 if ((end - start) != size) { 1214 if ((end - start) != size) {
1233 sms_info("%s invalid size %d expected %d\n", 1215 sms_info("invalid size %d expected %d",
1234 __func__, (int)(end - start), (int) size); 1216 (int)(end - start), (int) size);
1235 return -EINVAL; 1217 return -EINVAL;
1236 } 1218 }
1237 1219
1238 if (remap_pfn_range(vma, start, 1220 if (remap_pfn_range(vma, start,
1239 coredev->common_buffer_phys >> PAGE_SHIFT, 1221 coredev->common_buffer_phys >> PAGE_SHIFT,
1240 size, pgprot_noncached(vma->vm_page_prot))) { 1222 size, pgprot_noncached(vma->vm_page_prot))) {
1241 sms_info("%s remap_page_range failed\n", __func__); 1223 sms_info("remap_page_range failed");
1242 return -EAGAIN; 1224 return -EAGAIN;
1243 } 1225 }
1244 1226
@@ -1262,7 +1244,7 @@ int smscore_module_init(void)
1262 /* DVB Register */ 1244 /* DVB Register */
1263 rc = smsdvb_register(); 1245 rc = smsdvb_register();
1264 1246
1265 sms_info("%s, rc %d\n", __func__, rc); 1247 sms_debug("rc %d", rc);
1266 1248
1267 return rc; 1249 return rc;
1268} 1250}
@@ -1298,7 +1280,7 @@ void smscore_module_exit(void)
1298 /* Unregister USB */ 1280 /* Unregister USB */
1299 smsusb_unregister(); 1281 smsusb_unregister();
1300 1282
1301 sms_info("%s\n", __func__); 1283 sms_debug("");
1302} 1284}
1303 1285
1304module_init(smscore_module_init); 1286module_init(smscore_module_init);
diff --git a/drivers/media/dvb/siano/smscoreapi.h b/drivers/media/dvb/siano/smscoreapi.h
index 2799ea7bb41a..ccc7e1012958 100644
--- a/drivers/media/dvb/siano/smscoreapi.h
+++ b/drivers/media/dvb/siano/smscoreapi.h
@@ -414,9 +414,12 @@ void smsdvb_unregister(void);
414int smsusb_register(void); 414int smsusb_register(void);
415void smsusb_unregister(void); 415void smsusb_unregister(void);
416 416
417#define sms_err(fmt, arg...) printk(KERN_ERR fmt, ##arg) 417#define sms_err(fmt, arg...) \
418#define sms_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) 418 printk(KERN_ERR "%s " fmt "\n", __func__, ##arg)
419#define sms_debug(fmt, arg...) printk(KERN_DEBUG fmt, ##arg) 419#define sms_info(fmt, arg...) \
420 printk(KERN_INFO "%s " fmt "\n", __func__, ##arg)
421#define sms_debug(fmt, arg...) \
422 printk(KERN_DEBUG "%s " fmt "\n", __func__, ##arg)
420 423
421 424
422#endif /* __smscoreapi_h__ */ 425#endif /* __smscoreapi_h__ */
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c
index 57ab7db56a65..a54e9c77edd8 100644
--- a/drivers/media/dvb/siano/smsdvb.c
+++ b/drivers/media/dvb/siano/smsdvb.c
@@ -113,7 +113,7 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed)
113 container_of(feed->demux, struct smsdvb_client_t, demux); 113 container_of(feed->demux, struct smsdvb_client_t, demux);
114 struct SmsMsgData_ST PidMsg; 114 struct SmsMsgData_ST PidMsg;
115 115
116 sms_debug("%s add pid %d(%x)\n", __func__, 116 sms_debug("add pid %d(%x)",
117 feed->pid, feed->pid); 117 feed->pid, feed->pid);
118 118
119 PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; 119 PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID;
@@ -133,7 +133,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed)
133 container_of(feed->demux, struct smsdvb_client_t, demux); 133 container_of(feed->demux, struct smsdvb_client_t, demux);
134 struct SmsMsgData_ST PidMsg; 134 struct SmsMsgData_ST PidMsg;
135 135
136 sms_debug("%s remove pid %d(%x)\n", __func__, 136 sms_debug("remove pid %d(%x)",
137 feed->pid, feed->pid); 137 feed->pid, feed->pid);
138 138
139 PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; 139 PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID;
@@ -220,7 +220,7 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)
220static int smsdvb_get_tune_settings(struct dvb_frontend *fe, 220static int smsdvb_get_tune_settings(struct dvb_frontend *fe,
221 struct dvb_frontend_tune_settings *tune) 221 struct dvb_frontend_tune_settings *tune)
222{ 222{
223 sms_debug("%s\n", __func__); 223 sms_debug("");
224 224
225 tune->min_delay_ms = 400; 225 tune->min_delay_ms = 400;
226 tune->step_size = 250000; 226 tune->step_size = 250000;
@@ -247,7 +247,7 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe,
247 Msg.Data[0] = fep->frequency; 247 Msg.Data[0] = fep->frequency;
248 Msg.Data[2] = 12000000; 248 Msg.Data[2] = 12000000;
249 249
250 sms_debug("%s freq %d band %d\n", __func__, 250 sms_debug("freq %d band %d",
251 fep->frequency, fep->u.ofdm.bandwidth); 251 fep->frequency, fep->u.ofdm.bandwidth);
252 252
253 switch (fep->u.ofdm.bandwidth) { 253 switch (fep->u.ofdm.bandwidth) {
@@ -268,7 +268,7 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe,
268 struct smsdvb_client_t *client = 268 struct smsdvb_client_t *client =
269 container_of(fe, struct smsdvb_client_t, frontend); 269 container_of(fe, struct smsdvb_client_t, frontend);
270 270
271 sms_debug("%s\n", __func__); 271 sms_debug("");
272 272
273 /* todo: */ 273 /* todo: */
274 memcpy(fep, &client->fe_params, 274 memcpy(fep, &client->fe_params,
@@ -322,14 +322,14 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
322 return 0; 322 return 0;
323 323
324 if (smscore_get_device_mode(coredev) != 4) { 324 if (smscore_get_device_mode(coredev) != 4) {
325 sms_err("%sSMS Device mode is not set for " 325 sms_err("SMS Device mode is not set for "
326 "DVB operation.\n", __func__); 326 "DVB operation.");
327 return 0; 327 return 0;
328 } 328 }
329 329
330 client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); 330 client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL);
331 if (!client) { 331 if (!client) {
332 sms_info("%s kmalloc() failed\n", __func__); 332 sms_info("kmalloc() failed");
333 return -ENOMEM; 333 return -ENOMEM;
334 } 334 }
335 335
@@ -339,8 +339,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
339 smscore_get_board_id(coredev))->name, 339 smscore_get_board_id(coredev))->name,
340 THIS_MODULE, device, adapter_nr); 340 THIS_MODULE, device, adapter_nr);
341 if (rc < 0) { 341 if (rc < 0) {
342 sms_err("%s dvb_register_adapter() failed %d\n", 342 sms_err("dvb_register_adapter() failed %d", rc);
343 __func__, rc);
344 goto adapter_error; 343 goto adapter_error;
345 } 344 }
346 345
@@ -353,8 +352,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
353 352
354 rc = dvb_dmx_init(&client->demux); 353 rc = dvb_dmx_init(&client->demux);
355 if (rc < 0) { 354 if (rc < 0) {
356 sms_err("%s dvb_dmx_init failed %d\n\n", 355 sms_err("dvb_dmx_init failed %d", rc);
357 __func__, rc);
358 goto dvbdmx_error; 356 goto dvbdmx_error;
359 } 357 }
360 358
@@ -365,8 +363,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
365 363
366 rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter); 364 rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter);
367 if (rc < 0) { 365 if (rc < 0) {
368 sms_err("%s dvb_dmxdev_init failed %d\n", 366 sms_err("dvb_dmxdev_init failed %d", rc);
369 __func__, rc);
370 goto dmxdev_error; 367 goto dmxdev_error;
371 } 368 }
372 369
@@ -376,8 +373,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
376 373
377 rc = dvb_register_frontend(&client->adapter, &client->frontend); 374 rc = dvb_register_frontend(&client->adapter, &client->frontend);
378 if (rc < 0) { 375 if (rc < 0) {
379 sms_err("%s frontend registration failed %d\n", 376 sms_err("frontend registration failed %d", rc);
380 __func__, rc);
381 goto frontend_error; 377 goto frontend_error;
382 } 378 }
383 379
@@ -389,8 +385,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
389 385
390 rc = smscore_register_client(coredev, &params, &client->smsclient); 386 rc = smscore_register_client(coredev, &params, &client->smsclient);
391 if (rc < 0) { 387 if (rc < 0) {
392 sms_info("%s smscore_register_client() failed %d\n", 388 sms_info("smscore_register_client() failed %d", rc);
393 __func__, rc);
394 goto client_error; 389 goto client_error;
395 } 390 }
396 391
@@ -405,7 +400,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
405 400
406 kmutex_unlock(&g_smsdvb_clientslock); 401 kmutex_unlock(&g_smsdvb_clientslock);
407 402
408 sms_info("%s success\n", __func__); 403 sms_info("success");
409 404
410 return 0; 405 return 0;
411 406
@@ -435,7 +430,7 @@ int smsdvb_register(void)
435 430
436 rc = smscore_register_hotplug(smsdvb_hotplug); 431 rc = smscore_register_hotplug(smsdvb_hotplug);
437 432
438 sms_info("%s\n", __func__); 433 sms_debug("");
439 434
440 return rc; 435 return rc;
441} 436}
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index 34e60482facb..01f5c74c41e9 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -60,8 +60,8 @@ void smsusb_onresponse(struct urb *urb)
60 struct smsusb_device_t *dev = surb->dev; 60 struct smsusb_device_t *dev = surb->dev;
61 61
62 if (urb->status < 0) { 62 if (urb->status < 0) {
63 sms_info("%s error, urb status %d, %d bytes\n", 63 sms_info("error, urb status %d, %d bytes",
64 __func__, urb->status, urb->actual_length); 64 urb->status, urb->actual_length);
65 return; 65 return;
66 } 66 }
67 67
@@ -81,9 +81,9 @@ void smsusb_onresponse(struct urb *urb)
81 /* sanity check */ 81 /* sanity check */
82 if (((int) phdr->msgLength + 82 if (((int) phdr->msgLength +
83 surb->cb->offset) > urb->actual_length) { 83 surb->cb->offset) > urb->actual_length) {
84 sms_info("%s: invalid response " 84 sms_info("invalid response "
85 "msglen %d offset %d " 85 "msglen %d offset %d "
86 "size %d\n", __func__, 86 "size %d",
87 phdr->msgLength, 87 phdr->msgLength,
88 surb->cb->offset, 88 surb->cb->offset,
89 urb->actual_length); 89 urb->actual_length);
@@ -100,8 +100,8 @@ void smsusb_onresponse(struct urb *urb)
100 smscore_onresponse(dev->coredev, surb->cb); 100 smscore_onresponse(dev->coredev, surb->cb);
101 surb->cb = NULL; 101 surb->cb = NULL;
102 } else { 102 } else {
103 sms_info("%s invalid response " 103 sms_info("invalid response "
104 "msglen %d actual %d\n", __func__, 104 "msglen %d actual %d",
105 phdr->msgLength, urb->actual_length); 105 phdr->msgLength, urb->actual_length);
106 } 106 }
107 } 107 }
@@ -115,8 +115,8 @@ int smsusb_submit_urb(struct smsusb_device_t *dev, struct smsusb_urb_t *surb)
115 if (!surb->cb) { 115 if (!surb->cb) {
116 surb->cb = smscore_getbuffer(dev->coredev); 116 surb->cb = smscore_getbuffer(dev->coredev);
117 if (!surb->cb) { 117 if (!surb->cb) {
118 sms_info("%s smscore_getbuffer(...) " 118 sms_info("smscore_getbuffer(...) "
119 "returned NULL\n", __func__); 119 "returned NULL");
120 return -ENOMEM; 120 return -ENOMEM;
121 } 121 }
122 } 122 }
@@ -157,8 +157,8 @@ int smsusb_start_streaming(struct smsusb_device_t *dev)
157 for (i = 0; i < MAX_URBS; i++) { 157 for (i = 0; i < MAX_URBS; i++) {
158 rc = smsusb_submit_urb(dev, &dev->surbs[i]); 158 rc = smsusb_submit_urb(dev, &dev->surbs[i]);
159 if (rc < 0) { 159 if (rc < 0) {
160 sms_info("%s smsusb_submit_urb(...) " 160 sms_info("smsusb_submit_urb(...) "
161 "failed\n", __func__); 161 "failed");
162 smsusb_stop_streaming(dev); 162 smsusb_stop_streaming(dev);
163 break; 163 break;
164 } 164 }
@@ -191,15 +191,14 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
191 int rc, dummy; 191 int rc, dummy;
192 192
193 if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) { 193 if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
194 sms_info("%s invalid firmware id specified %d\n", 194 sms_info("invalid firmware id specified %d", id);
195 __func__, id);
196 return -EINVAL; 195 return -EINVAL;
197 } 196 }
198 197
199 rc = request_firmware(&fw, smsusb1_fw_lkup[id], &udev->dev); 198 rc = request_firmware(&fw, smsusb1_fw_lkup[id], &udev->dev);
200 if (rc < 0) { 199 if (rc < 0) {
201 sms_info("%s failed to open \"%s\" mode %d\n", 200 sms_info("failed to open \"%s\" mode %d",
202 __func__, smsusb1_fw_lkup[id], id); 201 smsusb1_fw_lkup[id], id);
203 return rc; 202 return rc;
204 } 203 }
205 204
@@ -210,12 +209,11 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
210 rc = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 2), 209 rc = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 2),
211 fw_buffer, fw->size, &dummy, 1000); 210 fw_buffer, fw->size, &dummy, 1000);
212 211
213 sms_info("%s: sent %d(%d) bytes, rc %d\n", 212 sms_info("sent %d(%d) bytes, rc %d", fw->size, dummy, rc);
214 __func__, fw->size, dummy, rc);
215 213
216 kfree(fw_buffer); 214 kfree(fw_buffer);
217 } else { 215 } else {
218 sms_info("failed to allocate firmware buffer\n"); 216 sms_info("failed to allocate firmware buffer");
219 rc = -ENOMEM; 217 rc = -ENOMEM;
220 } 218 }
221 219
@@ -233,7 +231,7 @@ void smsusb1_detectmode(void *context, int *mode)
233 231
234 if (!product_string) { 232 if (!product_string) {
235 product_string = "none"; 233 product_string = "none";
236 sms_err("%s product string not found\n", __func__); 234 sms_err("product string not found");
237 } else if (strstr(product_string, "DVBH")) 235 } else if (strstr(product_string, "DVBH"))
238 *mode = 1; 236 *mode = 1;
239 else if (strstr(product_string, "BDA")) 237 else if (strstr(product_string, "BDA"))
@@ -243,7 +241,7 @@ void smsusb1_detectmode(void *context, int *mode)
243 else if (strstr(product_string, "TDMB")) 241 else if (strstr(product_string, "TDMB"))
244 *mode = 2; 242 *mode = 2;
245 243
246 sms_info("%s: %d \"%s\"\n", __func__, *mode, product_string); 244 sms_info("%d \"%s\"", *mode, product_string);
247} 245}
248 246
249int smsusb1_setmode(void *context, int mode) 247int smsusb1_setmode(void *context, int mode)
@@ -252,8 +250,7 @@ int smsusb1_setmode(void *context, int mode)
252 sizeof(struct SmsMsgHdr_ST), 0 }; 250 sizeof(struct SmsMsgHdr_ST), 0 };
253 251
254 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { 252 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
255 sms_info("%s invalid firmware id specified %d\n", 253 sms_info("invalid firmware id specified %d", mode);
256 __func__, mode);
257 return -EINVAL; 254 return -EINVAL;
258 } 255 }
259 256
@@ -274,7 +271,7 @@ void smsusb_term_device(struct usb_interface *intf)
274 271
275 kfree(dev); 272 kfree(dev);
276 273
277 sms_info("%s device %p destroyed\n", __func__, dev); 274 sms_info("device %p destroyed", dev);
278 } 275 }
279 276
280 usb_set_intfdata(intf, NULL); 277 usb_set_intfdata(intf, NULL);
@@ -290,8 +287,8 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
290 /* create device object */ 287 /* create device object */
291 dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); 288 dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
292 if (!dev) { 289 if (!dev) {
293 sms_info("%s kzalloc(sizeof(struct smsusb_device_t) " 290 sms_info("kzalloc(sizeof(struct smsusb_device_t) "
294 "failed\n", __func__); 291 "failed");
295 return -ENOMEM; 292 return -ENOMEM;
296 } 293 }
297 294
@@ -309,25 +306,24 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
309 params.setmode_handler = smsusb1_setmode; 306 params.setmode_handler = smsusb1_setmode;
310 params.detectmode_handler = smsusb1_detectmode; 307 params.detectmode_handler = smsusb1_detectmode;
311 params.device_type = SMS_STELLAR; 308 params.device_type = SMS_STELLAR;
312 sms_info("%s stellar device found\n", __func__); 309 sms_info("stellar device found");
313 break; 310 break;
314 default: 311 default:
315 switch (board->type) { 312 switch (board->type) {
316 case SMS_NOVA_A0: 313 case SMS_NOVA_A0:
317 params.device_type = SMS_NOVA_A0; 314 params.device_type = SMS_NOVA_A0;
318 sms_info("%s nova A0 found\n", __func__); 315 sms_info("nova A0 found");
319 break; 316 break;
320 case SMS_NOVA_B0: 317 case SMS_NOVA_B0:
321 params.device_type = SMS_NOVA_B0; 318 params.device_type = SMS_NOVA_B0;
322 sms_info("%s nova B0 found\n", __func__); 319 sms_info("nova B0 found");
323 break; 320 break;
324 case SMS_VEGA: 321 case SMS_VEGA:
325 params.device_type = SMS_VEGA; 322 params.device_type = SMS_VEGA;
326 sms_info("%s Vega found\n", __func__); 323 sms_info("Vega found");
327 break; 324 break;
328 default: 325 default:
329 sms_err("%s Unspecified sms device type!\n", 326 sms_err("Unspecified sms device type!");
330 __func__);
331 } 327 }
332 328
333 dev->buffer_size = USB2_BUFFER_SIZE; 329 dev->buffer_size = USB2_BUFFER_SIZE;
@@ -350,8 +346,8 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
350 /* register in smscore */ 346 /* register in smscore */
351 rc = smscore_register_device(&params, &dev->coredev); 347 rc = smscore_register_device(&params, &dev->coredev);
352 if (rc < 0) { 348 if (rc < 0) {
353 sms_info("%s smscore_register_device(...) failed, " 349 sms_info("smscore_register_device(...) failed, "
354 "rc %d\n", __func__, rc); 350 "rc %d", rc);
355 smsusb_term_device(intf); 351 smsusb_term_device(intf);
356 return rc; 352 return rc;
357 } 353 }
@@ -364,24 +360,22 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
364 usb_init_urb(&dev->surbs[i].urb); 360 usb_init_urb(&dev->surbs[i].urb);
365 } 361 }
366 362
367 sms_info("%s smsusb_start_streaming(...).\n", __func__); 363 sms_info("smsusb_start_streaming(...).");
368 rc = smsusb_start_streaming(dev); 364 rc = smsusb_start_streaming(dev);
369 if (rc < 0) { 365 if (rc < 0) {
370 sms_info("%s smsusb_start_streaming(...) failed\n", 366 sms_info("smsusb_start_streaming(...) failed");
371 __func__);
372 smsusb_term_device(intf); 367 smsusb_term_device(intf);
373 return rc; 368 return rc;
374 } 369 }
375 370
376 rc = smscore_start_device(dev->coredev); 371 rc = smscore_start_device(dev->coredev);
377 if (rc < 0) { 372 if (rc < 0) {
378 sms_info("%s smscore_start_device(...) failed\n", 373 sms_info("smscore_start_device(...) failed");
379 __func__);
380 smsusb_term_device(intf); 374 smsusb_term_device(intf);
381 return rc; 375 return rc;
382 } 376 }
383 377
384 sms_info("%s device %p created\n", __func__, dev); 378 sms_info("device %p created", dev);
385 379
386 return rc; 380 return rc;
387} 381}
@@ -399,36 +393,36 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
399 rc = usb_set_interface( 393 rc = usb_set_interface(
400 udev, intf->cur_altsetting->desc.bInterfaceNumber, 0); 394 udev, intf->cur_altsetting->desc.bInterfaceNumber, 0);
401 if (rc < 0) { 395 if (rc < 0) {
402 sms_info("%s usb_set_interface failed, " 396 sms_info("usb_set_interface failed, "
403 "rc %d\n", __func__, rc); 397 "rc %d", rc);
404 return rc; 398 return rc;
405 } 399 }
406 } 400 }
407 401
408 sms_info("smsusb_probe %d\n", 402 sms_info("smsusb_probe %d",
409 intf->cur_altsetting->desc.bInterfaceNumber); 403 intf->cur_altsetting->desc.bInterfaceNumber);
410 for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) 404 for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++)
411 sms_info("endpoint %d %02x %02x %d\n", i, 405 sms_info("endpoint %d %02x %02x %d", i,
412 intf->cur_altsetting->endpoint[i].desc.bEndpointAddress, 406 intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
413 intf->cur_altsetting->endpoint[i].desc.bmAttributes, 407 intf->cur_altsetting->endpoint[i].desc.bmAttributes,
414 intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize); 408 intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
415 409
416 if ((udev->actconfig->desc.bNumInterfaces == 2) && 410 if ((udev->actconfig->desc.bNumInterfaces == 2) &&
417 (intf->cur_altsetting->desc.bInterfaceNumber == 0)) { 411 (intf->cur_altsetting->desc.bInterfaceNumber == 0)) {
418 sms_info("rom interface 0 is not used\n"); 412 sms_info("rom interface 0 is not used");
419 return -ENODEV; 413 return -ENODEV;
420 } 414 }
421 415
422 if (intf->cur_altsetting->desc.bInterfaceNumber == 1) { 416 if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
423 snprintf(devpath, sizeof(devpath), "usb\\%d-%s", 417 snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
424 udev->bus->busnum, udev->devpath); 418 udev->bus->busnum, udev->devpath);
425 sms_info("stellar device was found.\n"); 419 sms_info("stellar device was found.");
426 return smsusb1_load_firmware( 420 return smsusb1_load_firmware(
427 udev, smscore_registry_getmode(devpath)); 421 udev, smscore_registry_getmode(devpath));
428 } 422 }
429 423
430 rc = smsusb_init_device(intf, id->driver_info); 424 rc = smsusb_init_device(intf, id->driver_info);
431 sms_info("%s rc %d\n", __func__, rc); 425 sms_info("rc %d", rc);
432 return rc; 426 return rc;
433} 427}
434 428
@@ -448,16 +442,16 @@ int smsusb_register(void)
448{ 442{
449 int rc = usb_register(&smsusb_driver); 443 int rc = usb_register(&smsusb_driver);
450 if (rc) 444 if (rc)
451 sms_info("usb_register failed. Error number %d\n", rc); 445 sms_info("usb_register failed. Error number %d", rc);
452 446
453 sms_info("%s\n", __func__); 447 sms_debug("");
454 448
455 return rc; 449 return rc;
456} 450}
457 451
458void smsusb_unregister(void) 452void smsusb_unregister(void)
459{ 453{
460 sms_debug("%s\n", __func__); 454 sms_debug("");
461 /* Regular USB Cleanup */ 455 /* Regular USB Cleanup */
462 usb_deregister(&smsusb_driver); 456 usb_deregister(&smsusb_driver);
463} 457}