Commit a0c0abcb authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (8294): sms1xxx: move message formatting into printk macros

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 068d6c0f
...@@ -157,8 +157,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) ...@@ -157,8 +157,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath)
strcpy(entry->devpath, devpath); strcpy(entry->devpath, devpath);
list_add(&entry->entry, &g_smscore_registry); list_add(&entry->entry, &g_smscore_registry);
} else } else
sms_err("%s failed to create smscore_registry.\n", sms_err("failed to create smscore_registry.");
__func__);
kmutex_unlock(&g_smscore_registrylock); kmutex_unlock(&g_smscore_registrylock);
return entry; return entry;
} }
...@@ -171,7 +170,7 @@ int smscore_registry_getmode(char *devpath) ...@@ -171,7 +170,7 @@ int smscore_registry_getmode(char *devpath)
if (entry) if (entry)
return entry->mode; return entry->mode;
else else
sms_err("%s No registry found.\n", __func__); sms_err("No registry found.");
return default_mode; return default_mode;
} }
...@@ -184,7 +183,7 @@ enum sms_device_type_st smscore_registry_gettype(char *devpath) ...@@ -184,7 +183,7 @@ enum sms_device_type_st smscore_registry_gettype(char *devpath)
if (entry) if (entry)
return entry->type; return entry->type;
else else
sms_err("%s No registry found.\n", __func__); sms_err("No registry found.");
return -1; return -1;
} }
...@@ -197,7 +196,7 @@ void smscore_registry_setmode(char *devpath, int mode) ...@@ -197,7 +196,7 @@ void smscore_registry_setmode(char *devpath, int mode)
if (entry) if (entry)
entry->mode = mode; entry->mode = mode;
else else
sms_err("%s No registry found.\n", __func__); sms_err("No registry found.");
} }
void smscore_registry_settype(char *devpath, enum sms_device_type_st type) void 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,7 +207,7 @@ void smscore_registry_settype(char *devpath, enum sms_device_type_st type)
if (entry) if (entry)
entry->type = type; entry->type = type;
else else
sms_err("%s No registry found.\n", __func__); sms_err("No registry found.");
} }
...@@ -331,7 +330,7 @@ struct smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer, ...@@ -331,7 +330,7 @@ struct smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer,
struct smscore_buffer_t *cb = struct smscore_buffer_t *cb =
kmalloc(sizeof(struct smscore_buffer_t), GFP_KERNEL); kmalloc(sizeof(struct smscore_buffer_t), GFP_KERNEL);
if (!cb) { if (!cb) {
sms_info("%s kmalloc(...) failed\n", __func__); sms_info("kmalloc(...) failed");
return NULL; return NULL;
} }
...@@ -360,7 +359,7 @@ int smscore_register_device(struct smsdevice_params_t *params, ...@@ -360,7 +359,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
dev = kzalloc(sizeof(struct smscore_device_t), GFP_KERNEL); dev = kzalloc(sizeof(struct smscore_device_t), GFP_KERNEL);
if (!dev) { if (!dev) {
sms_info("%s kzalloc(...) failed\n", __func__); sms_info("kzalloc(...) failed");
return -ENOMEM; return -ENOMEM;
} }
...@@ -408,8 +407,7 @@ int smscore_register_device(struct smsdevice_params_t *params, ...@@ -408,8 +407,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
smscore_putbuffer(dev, cb); smscore_putbuffer(dev, cb);
} }
sms_info("%s allocated %d buffers\n", sms_info("allocated %d buffers", dev->num_buffers);
__func__, dev->num_buffers);
dev->mode = DEVICE_MODE_NONE; dev->mode = DEVICE_MODE_NONE;
dev->context = params->context; dev->context = params->context;
...@@ -432,7 +430,7 @@ int smscore_register_device(struct smsdevice_params_t *params, ...@@ -432,7 +430,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
*coredev = dev; *coredev = dev;
sms_info("%s device %p created\n", __func__, dev); sms_info("device %p created", dev);
return 0; return 0;
} }
...@@ -450,8 +448,7 @@ int smscore_start_device(struct smscore_device_t *coredev) ...@@ -450,8 +448,7 @@ int smscore_start_device(struct smscore_device_t *coredev)
int rc = smscore_set_device_mode( int rc = smscore_set_device_mode(
coredev, smscore_registry_getmode(coredev->devpath)); coredev, smscore_registry_getmode(coredev->devpath));
if (rc < 0) { if (rc < 0) {
sms_info("%s set device mode faile , rc %d\n", sms_info("set device mode faile , rc %d", rc);
__func__, rc);
return rc; return rc;
} }
...@@ -459,8 +456,7 @@ int smscore_start_device(struct smscore_device_t *coredev) ...@@ -459,8 +456,7 @@ int smscore_start_device(struct smscore_device_t *coredev)
rc = smscore_notify_callbacks(coredev, coredev->device, 1); rc = smscore_notify_callbacks(coredev, coredev->device, 1);
sms_info("%s device %p started, rc %d\n", sms_info("device %p started, rc %d", coredev, rc);
__func__, coredev, rc);
kmutex_unlock(&g_smscore_deviceslock); kmutex_unlock(&g_smscore_deviceslock);
...@@ -472,8 +468,7 @@ int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, void *buffer, ...@@ -472,8 +468,7 @@ int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, void *buffer,
{ {
int rc = coredev->sendrequest_handler(coredev->context, buffer, size); int rc = coredev->sendrequest_handler(coredev->context, buffer, size);
if (rc < 0) { if (rc < 0) {
sms_info("%s sendrequest returned error %d\n", sms_info("sendrequest returned error %d", rc);
__func__, rc);
return rc; return rc;
} }
...@@ -491,8 +486,8 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev, ...@@ -491,8 +486,8 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev,
u8 *payload = firmware->Payload; u8 *payload = firmware->Payload;
int rc = 0; int rc = 0;
sms_info("%s loading FW to addr 0x%x size %d\n", sms_info("loading FW to addr 0x%x size %d",
__func__, mem_address, firmware->Length); mem_address, firmware->Length);
if (coredev->preload_handler) { if (coredev->preload_handler) {
rc = coredev->preload_handler(coredev->context); rc = coredev->preload_handler(coredev->context);
if (rc < 0) if (rc < 0)
...@@ -505,7 +500,7 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev, ...@@ -505,7 +500,7 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev,
return -ENOMEM; return -ENOMEM;
if (coredev->mode != DEVICE_MODE_NONE) { if (coredev->mode != DEVICE_MODE_NONE) {
PDEBUG("Sending reload command\n"); PDEBUG("Sending reload command");
SMS_INIT_MSG(msg, MSG_SW_RELOAD_START_REQ, SMS_INIT_MSG(msg, MSG_SW_RELOAD_START_REQ,
sizeof(struct SmsMsgHdr_ST)); sizeof(struct SmsMsgHdr_ST));
rc = smscore_sendrequest_and_wait(coredev, msg, rc = smscore_sendrequest_and_wait(coredev, msg,
...@@ -578,7 +573,7 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev, ...@@ -578,7 +573,7 @@ int smscore_load_firmware_family2(struct smscore_device_t *coredev,
msleep(500); msleep(500);
} }
sms_debug("%s rc=%d, postload=%p \n", __func__, rc, sms_debug("rc=%d, postload=%p ", rc,
coredev->postload_handler); coredev->postload_handler);
kfree(msg); kfree(msg);
...@@ -612,12 +607,10 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev, ...@@ -612,12 +607,10 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
rc = request_firmware(&fw, filename, coredev->device); rc = request_firmware(&fw, filename, coredev->device);
if (rc < 0) { if (rc < 0) {
sms_info("%s failed to open \"%s\"\n", sms_info("failed to open \"%s\"", filename);
__func__, filename);
return rc; return rc;
} }
sms_info("%s read FW %s, size=%d\"\n", __func__, sms_info("read FW %s, size=%d\"", filename, fw->size);
filename, fw->size);
fw_buffer = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT), fw_buffer = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT),
GFP_KERNEL | GFP_DMA); GFP_KERNEL | GFP_DMA);
if (fw_buffer) { if (fw_buffer) {
...@@ -632,8 +625,7 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev, ...@@ -632,8 +625,7 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
kfree(fw_buffer); kfree(fw_buffer);
} else { } else {
sms_info("%s failed to allocate firmware buffer\n", sms_info("failed to allocate firmware buffer");
__func__);
rc = -ENOMEM; rc = -ENOMEM;
} }
...@@ -645,7 +637,7 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev, ...@@ -645,7 +637,7 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
int smscore_load_firmware_from_buffer(struct smscore_device_t *coredev, int smscore_load_firmware_from_buffer(struct smscore_device_t *coredev,
u8 *buffer, int size, int new_mode) u8 *buffer, int size, int new_mode)
{ {
PERROR("Feature not implemented yet\n"); PERROR("Feature not implemented yet");
return -EFAULT; return -EFAULT;
} }
...@@ -680,17 +672,17 @@ void smscore_unregister_device(struct smscore_device_t *coredev) ...@@ -680,17 +672,17 @@ void smscore_unregister_device(struct smscore_device_t *coredev)
if (num_buffers == coredev->num_buffers) if (num_buffers == coredev->num_buffers)
break; break;
if (++retry > 10) { if (++retry > 10) {
sms_info("%s exiting although " sms_info("exiting although "
"not all buffers released.\n", __func__); "not all buffers released.");
break; break;
} }
sms_info("%s waiting for %d buffer(s)\n", __func__, sms_info("waiting for %d buffer(s)",
coredev->num_buffers - num_buffers); coredev->num_buffers - num_buffers);
msleep(100); msleep(100);
} }
sms_info("%s freed %d buffers\n", __func__, num_buffers); sms_info("freed %d buffers", num_buffers);
if (coredev->common_buffer) if (coredev->common_buffer)
dma_free_coherent(NULL, coredev->common_buffer_size, dma_free_coherent(NULL, coredev->common_buffer_size,
...@@ -702,7 +694,7 @@ void smscore_unregister_device(struct smscore_device_t *coredev) ...@@ -702,7 +694,7 @@ void smscore_unregister_device(struct smscore_device_t *coredev)
kmutex_unlock(&g_smscore_deviceslock); kmutex_unlock(&g_smscore_deviceslock);
sms_info("%s device %p destroyed\n", __func__, coredev); sms_info("device %p destroyed", coredev);
} }
int smscore_detect_mode(struct smscore_device_t *coredev) int smscore_detect_mode(struct smscore_device_t *coredev)
...@@ -722,8 +714,7 @@ int smscore_detect_mode(struct smscore_device_t *coredev) ...@@ -722,8 +714,7 @@ int smscore_detect_mode(struct smscore_device_t *coredev)
rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength, rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength,
&coredev->version_ex_done); &coredev->version_ex_done);
if (rc == -ETIME) { if (rc == -ETIME) {
sms_err("%s: MSG_SMS_GET_VERSION_EX_REQ " sms_err("MSG_SMS_GET_VERSION_EX_REQ failed first try");
"failed first try\n", __func__);
if (wait_for_completion_timeout(&coredev->resume_done, if (wait_for_completion_timeout(&coredev->resume_done,
msecs_to_jiffies(5000))) { msecs_to_jiffies(5000))) {
...@@ -731,9 +722,8 @@ int smscore_detect_mode(struct smscore_device_t *coredev) ...@@ -731,9 +722,8 @@ int smscore_detect_mode(struct smscore_device_t *coredev)
coredev, msg, msg->msgLength, coredev, msg, msg->msgLength,
&coredev->version_ex_done); &coredev->version_ex_done);
if (rc < 0) if (rc < 0)
sms_err("%s: " sms_err("MSG_SMS_GET_VERSION_EX_REQ failed "
"MSG_SMS_GET_VERSION_EX_REQ failed " "second try, rc %d", rc);
"second try, rc %d\n", __func__, rc);
} else } else
rc = -ETIME; rc = -ETIME;
} }
...@@ -780,11 +770,10 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) ...@@ -780,11 +770,10 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
int rc = 0; int rc = 0;
enum sms_device_type_st type; enum sms_device_type_st type;
PDEBUG("set device mode to %d\n", mode); PDEBUG("set device mode to %d", mode);
if (coredev->device_flags & SMS_DEVICE_FAMILY2) { if (coredev->device_flags & SMS_DEVICE_FAMILY2) {
if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_RAW_TUNER) { if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_RAW_TUNER) {
sms_info("%s invalid mode specified %d\n", sms_info("invalid mode specified %d", mode);
__func__, mode);
return -EINVAL; return -EINVAL;
} }
...@@ -793,15 +782,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) ...@@ -793,15 +782,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) { if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) {
rc = smscore_detect_mode(coredev); rc = smscore_detect_mode(coredev);
if (rc < 0) { if (rc < 0) {
sms_info("%s mode detect failed %d\n", sms_info("mode detect failed %d", rc);
__func__, rc);
return rc; return rc;
} }
} }
if (coredev->mode == mode) { if (coredev->mode == mode) {
sms_info("%s device mode %d already set\n", sms_info("device mode %d already set", mode);
__func__, mode);
return 0; return 0;
} }
...@@ -810,13 +797,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) ...@@ -810,13 +797,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
rc = smscore_load_firmware_from_file( rc = smscore_load_firmware_from_file(
coredev, smscore_fw_lkup[mode][type], NULL); coredev, smscore_fw_lkup[mode][type], NULL);
if (rc < 0) { if (rc < 0) {
sms_info("%s load firmware " sms_info("load firmware "
"failed %d\n", __func__, rc); "failed %d", rc);
return rc; return rc;
} }
} else } else
sms_info("%s mode %d supported by running " sms_info("mode %d supported by running "
"firmware\n", __func__, mode); "firmware", mode);
buffer = kmalloc(sizeof(struct SmsMsgData_ST) + buffer = kmalloc(sizeof(struct SmsMsgData_ST) +
SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA);
...@@ -835,14 +822,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) ...@@ -835,14 +822,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
kfree(buffer); kfree(buffer);
} else { } else {
sms_info("%s Could not allocate buffer for " sms_info("Could not allocate buffer for "
"init device message.\n", __func__); "init device message.");
rc = -ENOMEM; rc = -ENOMEM;
} }
} else { } else {
if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
sms_info("%s invalid mode specified %d\n", sms_info("invalid mode specified %d", mode);
__func__, mode);
return -EINVAL; return -EINVAL;
} }
...@@ -862,7 +848,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) ...@@ -862,7 +848,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
} }
if (rc != 0) if (rc != 0)
sms_info("%s return error code %d.\n", __func__, rc); sms_info("return error code %d.", rc);
return rc; return rc;
} }
...@@ -945,7 +931,7 @@ void smscore_onresponse(struct smscore_device_t *coredev, ...@@ -945,7 +931,7 @@ void smscore_onresponse(struct smscore_device_t *coredev,
last_sample_time = time_now; last_sample_time = time_now;
if (time_now - last_sample_time > 10000) { if (time_now - last_sample_time > 10000) {
sms_debug("\n%s data rate %d bytes/secs\n", __func__, sms_debug("\ndata rate %d bytes/secs",
(int)((data_total * 1000) / (int)((data_total * 1000) /
(time_now - last_sample_time))); (time_now - last_sample_time)));
...@@ -965,8 +951,8 @@ void smscore_onresponse(struct smscore_device_t *coredev, ...@@ -965,8 +951,8 @@ void smscore_onresponse(struct smscore_device_t *coredev,
{ {
struct SmsVersionRes_ST *ver = struct SmsVersionRes_ST *ver =
(struct SmsVersionRes_ST *) phdr; (struct SmsVersionRes_ST *) phdr;
sms_debug("%s: MSG_SMS_GET_VERSION_EX_RES " sms_debug("MSG_SMS_GET_VERSION_EX_RES "
"id %d prots 0x%x ver %d.%d\n", __func__, "id %d prots 0x%x ver %d.%d",
ver->FirmwareId, ver->SupportedProtocols, ver->FirmwareId, ver->SupportedProtocols,
ver->RomVersionMajor, ver->RomVersionMinor); ver->RomVersionMajor, ver->RomVersionMinor);
...@@ -978,25 +964,21 @@ void smscore_onresponse(struct smscore_device_t *coredev, ...@@ -978,25 +964,21 @@ void smscore_onresponse(struct smscore_device_t *coredev,
break; break;
} }
case MSG_SMS_INIT_DEVICE_RES: case MSG_SMS_INIT_DEVICE_RES:
sms_debug("%s: MSG_SMS_INIT_DEVICE_RES\n", sms_debug("MSG_SMS_INIT_DEVICE_RES");
__func__);
complete(&coredev->init_device_done); complete(&coredev->init_device_done);
break; break;
case MSG_SW_RELOAD_START_RES: case MSG_SW_RELOAD_START_RES:
sms_debug("%s: MSG_SW_RELOAD_START_RES\n", sms_debug("MSG_SW_RELOAD_START_RES");
__func__);
complete(&coredev->reload_start_done); complete(&coredev->reload_start_done);
break; break;
case MSG_SMS_DATA_DOWNLOAD_RES: case MSG_SMS_DATA_DOWNLOAD_RES:
complete(&coredev->data_download_done); complete(&coredev->data_download_done);
break; break;
case MSG_SW_RELOAD_EXEC_RES: case MSG_SW_RELOAD_EXEC_RES:
sms_debug("%s: MSG_SW_RELOAD_EXEC_RES\n", sms_debug("MSG_SW_RELOAD_EXEC_RES");
__func__);
break; break;
case MSG_SMS_SWDOWNLOAD_TRIGGER_RES: case MSG_SMS_SWDOWNLOAD_TRIGGER_RES:
sms_debug("%s: MSG_SMS_SWDOWNLOAD_TRIGGER_RES\n", sms_debug("MSG_SMS_SWDOWNLOAD_TRIGGER_RES");
__func__);
complete(&coredev->trigger_done); complete(&coredev->trigger_done);
break; break;
case MSG_SMS_SLEEP_RESUME_COMP_IND: case MSG_SMS_SLEEP_RESUME_COMP_IND:
...@@ -1056,7 +1038,7 @@ int smscore_validate_client(struct smscore_device_t *coredev, ...@@ -1056,7 +1038,7 @@ int smscore_validate_client(struct smscore_device_t *coredev,
struct smscore_client_t *registered_client; struct smscore_client_t *registered_client;
if (!client) { if (!client) {
PERROR("bad parameter.\n"); PERROR("bad parameter.");
return -EFAULT; return -EFAULT;
} }
registered_client = smscore_find_client(coredev, data_type, id); registered_client = smscore_find_client(coredev, data_type, id);
...@@ -1064,12 +1046,12 @@ int smscore_validate_client(struct smscore_device_t *coredev, ...@@ -1064,12 +1046,12 @@ int smscore_validate_client(struct smscore_device_t *coredev,
return 0; return 0;
if (registered_client) { if (registered_client) {
PERROR("The msg ID already registered to another client.\n"); PERROR("The msg ID already registered to another client.");
return -EEXIST; return -EEXIST;
} }
listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL);
if (!listentry) { if (!listentry) {
PERROR("Can't allocate memory for client id.\n"); PERROR("Can't allocate memory for client id.");
return -ENOMEM; return -ENOMEM;
} }
listentry->id = id; listentry->id = id;
...@@ -1101,13 +1083,13 @@ int smscore_register_client(struct smscore_device_t *coredev, ...@@ -1101,13 +1083,13 @@ int smscore_register_client(struct smscore_device_t *coredev,
/* check that no other channel with same parameters exists */ /* check that no other channel with same parameters exists */
if (smscore_find_client(coredev, params->data_type, if (smscore_find_client(coredev, params->data_type,
params->initial_id)) { params->initial_id)) {
PERROR("Client already exist.\n"); PERROR("Client already exist.");
return -EEXIST; return -EEXIST;
} }
newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL);
if (!newclient) { if (!newclient) {
PERROR("Failed to allocate memory for client.\n"); PERROR("Failed to allocate memory for client.");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1121,7 +1103,7 @@ int smscore_register_client(struct smscore_device_t *coredev, ...@@ -1121,7 +1103,7 @@ int smscore_register_client(struct smscore_device_t *coredev,
smscore_validate_client(coredev, newclient, params->data_type, smscore_validate_client(coredev, newclient, params->data_type,
params->initial_id); params->initial_id);
*client = newclient; *client = newclient;
PDEBUG("%p %d %d\n", params->context, params->data_type, PDEBUG("%p %d %d", params->context, params->data_type,
params->initial_id); params->initial_id);
return 0; return 0;
...@@ -1149,7 +1131,7 @@ void smscore_unregister_client(struct smscore_client_t *client) ...@@ -1149,7 +1131,7 @@ void smscore_unregister_client(struct smscore_client_t *client)
kfree(identry); kfree(identry);
} }
sms_info("%s %p\n", __func__, client->context); sms_info("%p", client->context);
list_del(&client->entry); list_del(&client->entry);
kfree(client); kfree(client);
...@@ -1176,7 +1158,7 @@ int smsclient_sendrequest(struct smscore_client_t *client, ...@@ -1176,7 +1158,7 @@ int smsclient_sendrequest(struct smscore_client_t *client,
int rc; int rc;
if (client == NULL) { if (client == NULL) {
sms_err("%s Got NULL client\n", __func__); sms_err("Got NULL client");
return -EINVAL; return -EINVAL;
} }
...@@ -1184,7 +1166,7 @@ int smsclient_sendrequest(struct smscore_client_t *client, ...@@ -1184,7 +1166,7 @@ int smsclient_sendrequest(struct smscore_client_t *client,
/* check that no other channel with same id exists */ /* check that no other channel with same id exists */
if (coredev == NULL) { if (coredev == NULL) {
sms_err("%s Got NULL coredev\n", __func__); sms_err("Got NULL coredev");
return -EINVAL; return -EINVAL;
} }
...@@ -1225,20 +1207,20 @@ int smscore_map_common_buffer(struct smscore_device_t *coredev, ...@@ -1225,20 +1207,20 @@ int smscore_map_common_buffer(struct smscore_device_t *coredev,
if (!(vma->vm_flags & (VM_READ | VM_SHARED)) || if (!(vma->vm_flags & (VM_READ | VM_SHARED)) ||
(vma->vm_flags & VM_WRITE)) { (vma->vm_flags & VM_WRITE)) {
sms_info("%s invalid vm flags\n", __func__); sms_info("invalid vm flags");
return -EINVAL; return -EINVAL;
} }
if ((end - start) != size) { if ((end - start) != size) {
sms_info("%s invalid size %d expected %d\n", sms_info("invalid size %d expected %d",
__func__, (int)(end - start), (int) size); (int)(end - start), (int) size);
return -EINVAL; return -EINVAL;
} }
if (remap_pfn_range(vma, start, if (remap_pfn_range(vma, start,
coredev->common_buffer_phys >> PAGE_SHIFT, coredev->common_buffer_phys >> PAGE_SHIFT,
size, pgprot_noncached(vma->vm_page_prot))) { size, pgprot_noncached(vma->vm_page_prot))) {
sms_info("%s remap_page_range failed\n", __func__); sms_info("remap_page_range failed");
return -EAGAIN; return -EAGAIN;
} }
...@@ -1262,7 +1244,7 @@ int smscore_module_init(void) ...@@ -1262,7 +1244,7 @@ int smscore_module_init(void)
/* DVB Register */ /* DVB Register */
rc = smsdvb_register(); rc = smsdvb_register();
sms_info("%s, rc %d\n", __func__, rc); sms_debug("rc %d", rc);
return rc; return rc;
} }
...@@ -1298,7 +1280,7 @@ void smscore_module_exit(void) ...@@ -1298,7 +1280,7 @@ void smscore_module_exit(void)
/* Unregister USB */ /* Unregister USB */
smsusb_unregister(); smsusb_unregister();
sms_info("%s\n", __func__); sms_debug("");
} }
module_init(smscore_module_init); module_init(smscore_module_init);
......
...@@ -414,9 +414,12 @@ void smsdvb_unregister(void); ...@@ -414,9 +414,12 @@ void smsdvb_unregister(void);
int smsusb_register(void); int smsusb_register(void);
void smsusb_unregister(void); void smsusb_unregister(void);
#define sms_err(fmt, arg...) printk(KERN_ERR fmt, ##arg) #define sms_err(fmt, arg...) \
#define sms_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) printk(KERN_ERR "%s " fmt "\n", __func__, ##arg)
#define sms_debug(fmt, arg...) printk(KERN_DEBUG fmt, ##arg) #define sms_info(fmt, arg...) \
printk(KERN_INFO "%s " fmt "\n", __func__, ##arg)
#define sms_debug(fmt, arg...) \
printk(KERN_DEBUG "%s " fmt "\n", __func__, ##arg)
#endif /* __smscoreapi_h__ */ #endif /* __smscoreapi_h__ */
...@@ -113,7 +113,7 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed) ...@@ -113,7 +113,7 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed)
container_of(feed->demux, struct smsdvb_client_t, demux); container_of(feed->demux, struct smsdvb_client_t, demux);
struct SmsMsgData_ST PidMsg; struct SmsMsgData_ST PidMsg;
sms_debug("%s add pid %d(%x)\n", __func__, sms_debug("add pid %d(%x)",
feed->pid, feed->pid); feed->pid, feed->pid);
PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID;
...@@ -133,7 +133,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed) ...@@ -133,7 +133,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed)
container_of(feed->demux, struct smsdvb_client_t, demux); container_of(feed->demux, struct smsdvb_client_t, demux);
struct SmsMsgData_ST PidMsg; struct SmsMsgData_ST PidMsg;
sms_debug("%s remove pid %d(%x)\n", __func__, sms_debug("remove pid %d(%x)",
feed->pid, feed->pid); feed->pid, feed->pid);
PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID;
...@@ -220,7 +220,7 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -220,7 +220,7 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)
static int smsdvb_get_tune_settings(struct dvb_frontend *fe, static int smsdvb_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *tune) struct dvb_frontend_tune_settings *tune)
{ {
sms_debug("%s\n", __func__); sms_debug("");
tune->min_delay_ms = 400; tune->min_delay_ms = 400;
tune->step_size = 250000; tune->step_size = 250000;
...@@ -247,7 +247,7 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe, ...@@ -247,7 +247,7 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe,
Msg.Data[0] = fep->frequency; Msg.Data[0] = fep->frequency;
Msg.Data[2] = 12000000; Msg.Data[2] = 12000000;
sms_debug("%s freq %d band %d\n", __func__, sms_debug("freq %d band %d",
fep->frequency, fep->u.ofdm.bandwidth); fep->frequency, fep->u.ofdm.bandwidth);
switch (fep->u.ofdm.bandwidth) { switch (fep->u.ofdm.bandwidth) {
...@@ -268,7 +268,7 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe, ...@@ -268,7 +268,7 @@ static int smsdvb_get_frontend(struct dvb_frontend *fe,
struct smsdvb_client_t *client = struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend); container_of(fe, struct smsdvb_client_t, frontend);
sms_debug("%s\n", __func__); sms_debug("");
/* todo: */ /* todo: */
memcpy(fep, &client->fe_params, memcpy(fep, &client->fe_params,
...@@ -322,14 +322,14 @@ int smsdvb_hotplug(struct smscore_device_t *coredev, ...@@ -322,14 +322,14 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
return 0; return 0;
if (smscore_get_device_mode(coredev) != 4) { if (smscore_get_device_mode(coredev) != 4) {
sms_err("%sSMS Device mode is not set for " sms_err("SMS Device mode is not set for "
"DVB operation.\n", __func__); "DVB operation.");
return 0; return 0;
} }
client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL);
if (!client) { if (!client) {
sms_info("%s kmalloc() failed\n", __func__); sms_info("kmalloc() failed");
return -ENOMEM; return -ENOMEM;
} }
...@@ -339,8 +339,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev, ...@@ -339,8 +339,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
smscore_get_board_id(coredev))->name, smscore_get_board_id(coredev))->name,
THIS_MODULE, device, adapter_nr); THIS_MODULE, device, adapter_nr);
if (rc < 0) { if (rc < 0) {
sms_err("%s dvb_register_adapter() failed %d\n", sms_err("dvb_register_adapter() failed %d", rc);
__func__, rc);
goto adapter_error; goto adapter_error;
} }
...@@ -353,8 +352,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev, ...@@ -353,8 +352,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
rc = dvb_dmx_init(&client->demux); rc = dvb_dmx_init(&client->demux);
if (rc < 0) { if (rc < 0) {
sms_err("%s dvb_dmx_init failed %d\n\n", sms_err("dvb_dmx_init failed %d", rc);
__func__, rc);
goto dvbdmx_error; goto dvbdmx_error;
} }
...@@ -365,8 +363,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev, ...@@ -365,8 +363,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter); rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter);
if (rc < 0) { if (rc < 0) {
sms_err("%s dvb_dmxdev_init failed %d\n", sms_err("dvb_dmxdev_init failed %d", rc);
__func__, rc);
goto dmxdev_error; goto dmxdev_error;
} }
...@@ -376,8 +373,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev, ...@@ -376,8 +373,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
rc = dvb_register_frontend(&client->adapter, &client->frontend); rc = dvb_register_frontend(&client->adapter, &client->frontend);
if (rc < 0) { if (rc < 0) {
sms_err("%s frontend registration failed %d\n", sms_err("frontend registration failed %d", rc);
__func__, rc);
goto frontend_error; goto frontend_error;
} }
...@@ -389,8 +385,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev, ...@@ -389,8 +385,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
rc = smscore_register_client(coredev, &params, &client->smsclient); rc = smscore_register_client(coredev, &params, &client->smsclient);
if (rc < 0) { if (rc < 0) {
sms_info("%s smscore_register_client() failed %d\n", sms_info("smscore_register_client() failed %d", rc);
__func__, rc);
goto client_error; goto client_error;
} }
...@@ -405,7 +400,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev, ...@@ -405,7 +400,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
kmutex_unlock(&g_smsdvb_clientslock); kmutex_unlock(&g_smsdvb_clientslock);
sms_info("%s success\n", __func__); sms_info("success");
return 0; return 0;
...@@ -435,7 +430,7 @@ int smsdvb_register(void) ...@@ -435,7 +430,7 @@ int smsdvb_register(void)
rc = smscore_register_hotplug(smsdvb_hotplug); rc = smscore_register_hotplug(smsdvb_hotplug);
sms_info("%s\n", __func__); sms_debug("");
return rc; return rc;
} }
......
...@@ -60,8 +60,8 @@ void smsusb_onresponse(struct urb *urb) ...@@ -60,8 +60,8 @@ void smsusb_onresponse(struct urb *urb)
struct smsusb_device_t *dev = surb->dev; struct smsusb_device_t *dev = surb->dev;
if (urb->status < 0) { if (urb->status < 0) {
sms_info("%s error, urb status %d, %d bytes\n", sms_info("error, urb status %d, %d bytes",
__func__, urb->status, urb->actual_length); urb->status, urb->actual_length);
return; return;
} }
...@@ -81,9 +81,9 @@ void smsusb_onresponse(struct urb *urb) ...@@ -81,9 +81,9 @@ void smsusb_onresponse(struct urb *urb)
/* sanity check */ /* sanity check */
if (((int) phdr->msgLength + if (((int) phdr->msgLength +
surb->cb->offset) > urb->actual_length) { surb->cb->offset) > urb->actual_length) {
sms_info("%s: invalid response " sms_info("invalid response "
"msglen %d offset %d " "msglen %d offset %d "
"size %d\n", __func__, "size %d",
phdr->msgLength, phdr->msgLength,
surb->cb->offset, surb->cb->offset,
urb->actual_length); urb->actual_length);
...@@ -100,8 +100,8 @@ void smsusb_onresponse(struct urb *urb) ...@@ -100,8 +100,8 @@ void smsusb_onresponse(struct urb *urb)
smscore_onresponse(dev->coredev, surb->cb); smscore_onresponse(dev->coredev, surb->cb);
surb->cb = NULL; surb->cb = NULL;
} else { } else {
sms_info("%s invalid response " sms_info("invalid response "
"msglen %d actual %d\n", __func__, "msglen %d actual %d",
phdr->msgLength, urb->actual_length); phdr->msgLength, urb->actual_length);
} }
} }
...@@ -115,8 +115,8 @@ int smsusb_submit_urb(struct smsusb_device_t *dev, struct smsusb_urb_t *surb) ...@@ -115,8 +115,8 @@ int smsusb_submit_urb(struct smsusb_device_t *dev, struct smsusb_urb_t *surb)
if (!surb->cb) { if (!surb->cb) {
surb->cb = smscore_getbuffer(dev->coredev); surb->cb = smscore_getbuffer(dev->coredev);
if (!surb->cb) { if (!surb->cb) {
sms_info("%s smscore_getbuffer(...) " sms_info("smscore_getbuffer(...) "
"returned NULL\n", __func__); "returned NULL");
return -ENOMEM; return -ENOMEM;
} }
} }
...@@ -157,8 +157,8 @@ int smsusb_start_streaming(struct smsusb_device_t *dev) ...@@ -157,8 +157,8 @@ int smsusb_start_streaming(struct smsusb_device_t *dev)
for (i = 0; i < MAX_URBS; i++) { for (i = 0; i < MAX_URBS; i++) {
rc = smsusb_submit_urb(dev, &dev->surbs[i]); rc = smsusb_submit_urb(dev, &dev->surbs[i]);
if (rc < 0) { if (rc < 0) {
sms_info("%s smsusb_submit_urb(...) " sms_info("smsusb_submit_urb(...) "
"failed\n", __func__); "failed");
smsusb_stop_streaming(dev); smsusb_stop_streaming(dev);
break; break;
} }
...@@ -191,15 +191,14 @@ int smsusb1_load_firmware(struct usb_device *udev, int id) ...@@ -191,15 +191,14 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
int rc, dummy; int rc, dummy;
if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) { if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
sms_info("%s invalid firmware id specified %d\n", sms_info("invalid firmware id specified %d", id);
__func__, id);
return -EINVAL; return -EINVAL;
} }
rc = request_firmware(&fw, smsusb1_fw_lkup[id], &udev->dev); rc = request_firmware(&fw, smsusb1_fw_lkup[id], &udev->dev);
if (rc < 0) { if (rc < 0) {
sms_info("%s failed to open \"%s\" mode %d\n", sms_info("failed to open \"%s\" mode %d",
__func__, smsusb1_fw_lkup[id], id); smsusb1_fw_lkup[id], id);
return rc; return rc;
} }
...@@ -210,12 +209,11 @@ int smsusb1_load_firmware(struct usb_device *udev, int id) ...@@ -210,12 +209,11 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
rc = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 2), rc = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 2),
fw_buffer, fw->size, &dummy, 1000); fw_buffer, fw->size, &dummy, 1000);
sms_info("%s: sent %d(%d) bytes, rc %d\n", sms_info("sent %d(%d) bytes, rc %d", fw->size, dummy, rc);
__func__, fw->size, dummy, rc);
kfree(fw_buffer); kfree(fw_buffer);
} else { } else {
sms_info("failed to allocate firmware buffer\n"); sms_info("failed to allocate firmware buffer");
rc = -ENOMEM; rc = -ENOMEM;
} }
...@@ -233,7 +231,7 @@ void smsusb1_detectmode(void *context, int *mode) ...@@ -233,7 +231,7 @@ void smsusb1_detectmode(void *context, int *mode)
if (!product_string) { if (!product_string) {
product_string = "none"; product_string = "none";
sms_err("%s product string not found\n", __func__); sms_err("product string not found");
} else if (strstr(product_string, "DVBH")) } else if (strstr(product_string, "DVBH"))
*mode = 1; *mode = 1;
else if (strstr(product_string, "BDA")) else if (strstr(product_string, "BDA"))
...@@ -243,7 +241,7 @@ void smsusb1_detectmode(void *context, int *mode) ...@@ -243,7 +241,7 @@ void smsusb1_detectmode(void *context, int *mode)
else if (strstr(product_string, "TDMB")) else if (strstr(product_string, "TDMB"))
*mode = 2; *mode = 2;
sms_info("%s: %d \"%s\"\n", __func__, *mode, product_string); sms_info("%d \"%s\"", *mode, product_string);
} }
int smsusb1_setmode(void *context, int mode) int smsusb1_setmode(void *context, int mode)
...@@ -252,8 +250,7 @@ int smsusb1_setmode(void *context, int mode) ...@@ -252,8 +250,7 @@ int smsusb1_setmode(void *context, int mode)
sizeof(struct SmsMsgHdr_ST), 0 }; sizeof(struct SmsMsgHdr_ST), 0 };
if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
sms_info("%s invalid firmware id specified %d\n", sms_info("invalid firmware id specified %d", mode);
__func__, mode);
return -EINVAL; return -EINVAL;
} }
...@@ -274,7 +271,7 @@ void smsusb_term_device(struct usb_interface *intf) ...@@ -274,7 +271,7 @@ void smsusb_term_device(struct usb_interface *intf)
kfree(dev); kfree(dev);
sms_info("%s device %p destroyed\n", __func__, dev); sms_info("device %p destroyed", dev);
} }
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
...@@ -290,8 +287,8 @@ int smsusb_init_device(struct usb_interface *intf, int board_id) ...@@ -290,8 +287,8 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
/* create device object */ /* create device object */
dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
if (!dev) { if (!dev) {
sms_info("%s kzalloc(sizeof(struct smsusb_device_t) " sms_info("kzalloc(sizeof(struct smsusb_device_t) "
"failed\n", __func__); "failed");
return -ENOMEM; return -ENOMEM;
} }
...@@ -309,25 +306,24 @@ int smsusb_init_device(struct usb_interface *intf, int board_id) ...@@ -309,25 +306,24 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
params.setmode_handler = smsusb1_setmode; params.setmode_handler = smsusb1_setmode;
params.detectmode_handler = smsusb1_detectmode; params.detectmode_handler = smsusb1_detectmode;
params.device_type = SMS_STELLAR; params.device_type = SMS_STELLAR;
sms_info("%s stellar device found\n", __func__); sms_info("stellar device found");
break; break;
default: default:
switch (board->type) { switch (board->type) {
case SMS_NOVA_A0: case SMS_NOVA_A0:
params.device_type = SMS_NOVA_A0; params.device_type = SMS_NOVA_A0;
sms_info("%s nova A0 found\n", __func__); sms_info("nova A0 found");
break; break;
case SMS_NOVA_B0: case SMS_NOVA_B0:
params.device_type = SMS_NOVA_B0; params.device_type = SMS_NOVA_B0;
sms_info("%s nova B0 found\n", __func__); sms_info("nova B0 found");
break; break;
case SMS_VEGA: case SMS_VEGA:
params.device_type = SMS_VEGA; params.device_type = SMS_VEGA;
sms_info("%s Vega found\n", __func__); sms_info("Vega found");
break; break;
default: default:
sms_err("%s Unspecified sms device type!\n", sms_err("Unspecified sms device type!");
__func__);
} }
dev->buffer_size = USB2_BUFFER_SIZE; dev->buffer_size = USB2_BUFFER_SIZE;
...@@ -350,8 +346,8 @@ int smsusb_init_device(struct usb_interface *intf, int board_id) ...@@ -350,8 +346,8 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
/* register in smscore */ /* register in smscore */
rc = smscore_register_device(&params, &dev->coredev); rc = smscore_register_device(&params, &dev->coredev);
if (rc < 0) { if (rc < 0) {
sms_info("%s smscore_register_device(...) failed, " sms_info("smscore_register_device(...) failed, "
"rc %d\n", __func__, rc); "rc %d", rc);
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
...@@ -364,24 +360,22 @@ int smsusb_init_device(struct usb_interface *intf, int board_id) ...@@ -364,24 +360,22 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
usb_init_urb(&dev->surbs[i].urb); usb_init_urb(&dev->surbs[i].urb);
} }
sms_info("%s smsusb_start_streaming(...).\n", __func__); sms_info("smsusb_start_streaming(...).");
rc = smsusb_start_streaming(dev); rc = smsusb_start_streaming(dev);
if (rc < 0) { if (rc < 0) {
sms_info("%s smsusb_start_streaming(...) failed\n", sms_info("smsusb_start_streaming(...) failed");
__func__);
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
rc = smscore_start_device(dev->coredev); rc = smscore_start_device(dev->coredev);
if (rc < 0) { if (rc < 0) {
sms_info("%s smscore_start_device(...) failed\n", sms_info("smscore_start_device(...) failed");
__func__);
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
sms_info("%s device %p created\n", __func__, dev); sms_info("device %p created", dev);
return rc; return rc;
} }
...@@ -399,36 +393,36 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -399,36 +393,36 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
rc = usb_set_interface( rc = usb_set_interface(
udev, intf->cur_altsetting->desc.bInterfaceNumber, 0); udev, intf->cur_altsetting->desc.bInterfaceNumber, 0);
if (rc < 0) { if (rc < 0) {
sms_info("%s usb_set_interface failed, " sms_info("usb_set_interface failed, "
"rc %d\n", __func__, rc); "rc %d", rc);
return rc; return rc;
} }
} }
sms_info("smsusb_probe %d\n", sms_info("smsusb_probe %d",
intf->cur_altsetting->desc.bInterfaceNumber); intf->cur_altsetting->desc.bInterfaceNumber);
for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++)
sms_info("endpoint %d %02x %02x %d\n", i, sms_info("endpoint %d %02x %02x %d", i,
intf->cur_altsetting->endpoint[i].desc.bEndpointAddress, intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
intf->cur_altsetting->endpoint[i].desc.bmAttributes, intf->cur_altsetting->endpoint[i].desc.bmAttributes,
intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize); intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
if ((udev->actconfig->desc.bNumInterfaces == 2) && if ((udev->actconfig->desc.bNumInterfaces == 2) &&
(intf->cur_altsetting->desc.bInterfaceNumber == 0)) { (intf->cur_altsetting->desc.bInterfaceNumber == 0)) {
sms_info("rom interface 0 is not used\n"); sms_info("rom interface 0 is not used");
return -ENODEV; return -ENODEV;
} }
if (intf->cur_altsetting->desc.bInterfaceNumber == 1) { if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
snprintf(devpath, sizeof(devpath), "usb\\%d-%s", snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
udev->bus->busnum, udev->devpath); udev->bus->busnum, udev->devpath);
sms_info("stellar device was found.\n"); sms_info("stellar device was found.");
return smsusb1_load_firmware( return smsusb1_load_firmware(
udev, smscore_registry_getmode(devpath)); udev, smscore_registry_getmode(devpath));
} }
rc = smsusb_init_device(intf, id->driver_info); rc = smsusb_init_device(intf, id->driver_info);
sms_info("%s rc %d\n", __func__, rc); sms_info("rc %d", rc);
return rc; return rc;
} }
...@@ -448,16 +442,16 @@ int smsusb_register(void) ...@@ -448,16 +442,16 @@ int smsusb_register(void)
{ {
int rc = usb_register(&smsusb_driver); int rc = usb_register(&smsusb_driver);
if (rc) if (rc)
sms_info("usb_register failed. Error number %d\n", rc); sms_info("usb_register failed. Error number %d", rc);
sms_info("%s\n", __func__); sms_debug("");
return rc; return rc;
} }
void smsusb_unregister(void) void smsusb_unregister(void)
{ {
sms_debug("%s\n", __func__); sms_debug("");
/* Regular USB Cleanup */ /* Regular USB Cleanup */
usb_deregister(&smsusb_driver); usb_deregister(&smsusb_driver);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment