[media] siano: replace sms_err by pr_err

Originally, sms_err() would be also displaying the line where
the error occurs, but the messages are clear enough. Also,
the function is always printed. So, no need for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab 2015-02-22 11:04:35 -03:00
Родитель 535bd1e96e
Коммит 5ed0a2c7ec
8 изменённых файлов: 69 добавлений и 79 удалений

Просмотреть файл

@ -232,7 +232,7 @@ int sms_board_event(struct smscore_device_t *coredev,
break; /* BOARD_EVENT_MULTIPLEX_ERRORS */ break; /* BOARD_EVENT_MULTIPLEX_ERRORS */
default: default:
sms_err("Unknown SMS board event"); pr_err("Unknown SMS board event\n");
break; break;
} }
return 0; return 0;

Просмотреть файл

@ -461,7 +461,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("failed to create smscore_registry."); pr_err("failed to create smscore_registry.\n");
kmutex_unlock(&g_smscore_registrylock); kmutex_unlock(&g_smscore_registrylock);
return entry; return entry;
} }
@ -474,7 +474,7 @@ int smscore_registry_getmode(char *devpath)
if (entry) if (entry)
return entry->mode; return entry->mode;
else else
sms_err("No registry found."); pr_err("No registry found.\n");
return default_mode; return default_mode;
} }
@ -488,7 +488,7 @@ static enum sms_device_type_st smscore_registry_gettype(char *devpath)
if (entry) if (entry)
return entry->type; return entry->type;
else else
sms_err("No registry found."); pr_err("No registry found.\n");
return -EINVAL; return -EINVAL;
} }
@ -501,7 +501,7 @@ static void smscore_registry_setmode(char *devpath, int mode)
if (entry) if (entry)
entry->mode = mode; entry->mode = mode;
else else
sms_err("No registry found."); pr_err("No registry found.\n");
} }
static void smscore_registry_settype(char *devpath, static void smscore_registry_settype(char *devpath,
@ -513,7 +513,7 @@ static void smscore_registry_settype(char *devpath,
if (entry) if (entry)
entry->type = type; entry->type = type;
else else
sms_err("No registry found."); pr_err("No registry found.\n");
} }
@ -791,7 +791,7 @@ static int smscore_init_ir(struct smscore_device_t *coredev)
rc = sms_ir_init(coredev); rc = sms_ir_init(coredev);
if (rc != 0) if (rc != 0)
sms_err("Error initialization DTV IR sub-module"); pr_err("Error initialization DTV IR sub-module\n");
else { else {
buffer = kmalloc(sizeof(struct sms_msg_data2) + buffer = kmalloc(sizeof(struct sms_msg_data2) +
SMS_DMA_ALIGNMENT, SMS_DMA_ALIGNMENT,
@ -813,8 +813,7 @@ static int smscore_init_ir(struct smscore_device_t *coredev)
kfree(buffer); kfree(buffer);
} else } else
sms_err pr_err("Sending IR initialization message failed\n");
("Sending IR initialization message failed");
} }
} else } else
sms_info("IR port has not been detected"); sms_info("IR port has not been detected");
@ -836,7 +835,7 @@ static int smscore_configure_board(struct smscore_device_t *coredev)
board = sms_get_board(coredev->board_id); board = sms_get_board(coredev->board_id);
if (!board) { if (!board) {
sms_err("no board configuration exist."); pr_err("no board configuration exist.\n");
return -EINVAL; return -EINVAL;
} }
@ -949,7 +948,7 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
msg->x_msg_header.msg_length, msg->x_msg_header.msg_length,
&coredev->reload_start_done); &coredev->reload_start_done);
if (rc < 0) { if (rc < 0) {
sms_err("device reload failed, rc %d", rc); pr_err("device reload failed, rc %d\n", rc);
goto exit_fw_download; goto exit_fw_download;
} }
mem_address = *(u32 *) &payload[20]; mem_address = *(u32 *) &payload[20];
@ -1155,7 +1154,7 @@ static int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
char *fw_filename = smscore_get_fw_filename(coredev, mode); char *fw_filename = smscore_get_fw_filename(coredev, mode);
if (!fw_filename) { if (!fw_filename) {
sms_err("mode %d not supported on this device", mode); pr_err("mode %d not supported on this device\n", mode);
return -ENOENT; return -ENOENT;
} }
sms_debug("Firmware name: %s", fw_filename); sms_debug("Firmware name: %s", fw_filename);
@ -1166,14 +1165,14 @@ static int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
rc = request_firmware(&fw, fw_filename, coredev->device); rc = request_firmware(&fw, fw_filename, coredev->device);
if (rc < 0) { if (rc < 0) {
sms_err("failed to open firmware file \"%s\"", fw_filename); pr_err("failed to open firmware file '%s'\n", fw_filename);
return rc; return rc;
} }
sms_info("read fw %s, buffer size=0x%zx", fw_filename, fw->size); sms_info("read fw %s, buffer size=0x%zx", fw_filename, fw->size);
fw_buf = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT), fw_buf = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT),
GFP_KERNEL | GFP_DMA); GFP_KERNEL | GFP_DMA);
if (!fw_buf) { if (!fw_buf) {
sms_err("failed to allocate firmware buffer"); pr_err("failed to allocate firmware buffer\n");
rc = -ENOMEM; rc = -ENOMEM;
} else { } else {
memcpy(fw_buf, fw->data, fw->size); memcpy(fw_buf, fw->data, fw->size);
@ -1272,7 +1271,7 @@ static int smscore_detect_mode(struct smscore_device_t *coredev)
rc = smscore_sendrequest_and_wait(coredev, msg, msg->msg_length, rc = smscore_sendrequest_and_wait(coredev, msg, msg->msg_length,
&coredev->version_ex_done); &coredev->version_ex_done);
if (rc == -ETIME) { if (rc == -ETIME) {
sms_err("MSG_SMS_GET_VERSION_EX_REQ failed first try"); pr_err("MSG_SMS_GET_VERSION_EX_REQ failed first try\n");
if (wait_for_completion_timeout(&coredev->resume_done, if (wait_for_completion_timeout(&coredev->resume_done,
msecs_to_jiffies(5000))) { msecs_to_jiffies(5000))) {
@ -1280,7 +1279,7 @@ static int smscore_detect_mode(struct smscore_device_t *coredev)
coredev, msg, msg->msg_length, coredev, msg, msg->msg_length,
&coredev->version_ex_done); &coredev->version_ex_done);
if (rc < 0) if (rc < 0)
sms_err("MSG_SMS_GET_VERSION_EX_REQ failed second try, rc %d", pr_err("MSG_SMS_GET_VERSION_EX_REQ failed second try, rc %d\n",
rc); rc);
} else } else
rc = -ETIME; rc = -ETIME;
@ -1309,7 +1308,7 @@ static int smscore_init_device(struct smscore_device_t *coredev, int mode)
buffer = kmalloc(sizeof(struct sms_msg_data) + buffer = kmalloc(sizeof(struct sms_msg_data) +
SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA);
if (!buffer) { if (!buffer) {
sms_err("Could not allocate buffer for init device message."); pr_err("Could not allocate buffer for init device message.\n");
return -ENOMEM; return -ENOMEM;
} }
@ -1343,7 +1342,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
sms_debug("set device mode to %d", mode); sms_debug("set device mode to %d", mode);
if (coredev->device_flags & SMS_DEVICE_FAMILY2) { if (coredev->device_flags & SMS_DEVICE_FAMILY2) {
if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) { if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) {
sms_err("invalid mode specified %d", mode); pr_err("invalid mode specified %d\n", mode);
return -EINVAL; return -EINVAL;
} }
@ -1352,7 +1351,7 @@ 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_err("mode detect failed %d", rc); pr_err("mode detect failed %d\n", rc);
return rc; return rc;
} }
} }
@ -1374,11 +1373,11 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
if (coredev->fw_version >= 0x800) { if (coredev->fw_version >= 0x800) {
rc = smscore_init_device(coredev, mode); rc = smscore_init_device(coredev, mode);
if (rc < 0) if (rc < 0)
sms_err("device init failed, rc %d.", rc); pr_err("device init failed, rc %d.\n", rc);
} }
} else { } else {
if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) { if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX) {
sms_err("invalid mode specified %d", mode); pr_err("invalid mode specified %d\n", mode);
return -EINVAL; return -EINVAL;
} }
@ -1415,7 +1414,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
} }
if (rc < 0) if (rc < 0)
sms_err("return error code %d.", rc); pr_err("return error code %d.\n", rc);
else else
sms_debug("Success setting device mode."); sms_debug("Success setting device mode.");
@ -1682,7 +1681,7 @@ static 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) {
sms_err("bad parameter."); pr_err("bad parameter.\n");
return -EINVAL; return -EINVAL;
} }
registered_client = smscore_find_client(coredev, data_type, id); registered_client = smscore_find_client(coredev, data_type, id);
@ -1690,12 +1689,12 @@ static int smscore_validate_client(struct smscore_device_t *coredev,
return 0; return 0;
if (registered_client) { if (registered_client) {
sms_err("The msg ID already registered to another client."); pr_err("The msg ID already registered to another client.\n");
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) {
sms_err("Can't allocate memory for client id."); pr_err("Can't allocate memory for client id.\n");
return -ENOMEM; return -ENOMEM;
} }
listentry->id = id; listentry->id = id;
@ -1727,13 +1726,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)) {
sms_err("Client already exist."); pr_err("Client already exist.\n");
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) {
sms_err("Failed to allocate memory for client."); pr_err("Failed to allocate memory for client.\n");
return -ENOMEM; return -ENOMEM;
} }
@ -1804,7 +1803,7 @@ int smsclient_sendrequest(struct smscore_client_t *client,
int rc; int rc;
if (client == NULL) { if (client == NULL) {
sms_err("Got NULL client"); pr_err("Got NULL client\n");
return -EINVAL; return -EINVAL;
} }
@ -1812,7 +1811,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("Got NULL coredev"); pr_err("Got NULL coredev\n");
return -EINVAL; return -EINVAL;
} }
@ -2017,9 +2016,9 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num,
if (rc != 0) { if (rc != 0) {
if (rc == -ETIME) if (rc == -ETIME)
sms_err("smscore_gpio_configure timeout"); pr_err("smscore_gpio_configure timeout\n");
else else
sms_err("smscore_gpio_configure error"); pr_err("smscore_gpio_configure error\n");
} }
free: free:
kfree(buffer); kfree(buffer);
@ -2066,9 +2065,9 @@ int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num,
if (rc != 0) { if (rc != 0) {
if (rc == -ETIME) if (rc == -ETIME)
sms_err("smscore_gpio_set_level timeout"); pr_err("smscore_gpio_set_level timeout\n");
else else
sms_err("smscore_gpio_set_level error"); pr_err("smscore_gpio_set_level error\n");
} }
kfree(buffer); kfree(buffer);
@ -2114,9 +2113,9 @@ int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num,
if (rc != 0) { if (rc != 0) {
if (rc == -ETIME) if (rc == -ETIME)
sms_err("smscore_gpio_get_level timeout"); pr_err("smscore_gpio_get_level timeout\n");
else else
sms_err("smscore_gpio_get_level error"); pr_err("smscore_gpio_get_level error\n");
} }
kfree(buffer); kfree(buffer);

Просмотреть файл

@ -1180,7 +1180,6 @@ int smscore_led_state(struct smscore_device_t *core, int led);
#define DBG_ADV 2 #define DBG_ADV 2
#define sms_log(fmt, arg...) pr_info(fmt "\n", ##arg) #define sms_log(fmt, arg...) pr_info(fmt "\n", ##arg)
#define sms_err(fmt, arg...) pr_err(fmt " on line: %d\n", ##arg, __LINE__)
#define sms_info(fmt, arg...) do {\ #define sms_info(fmt, arg...) do {\
if (sms_dbg & DBG_INFO) \ if (sms_dbg & DBG_INFO) \
pr_info(fmt "\n", ##arg); \ pr_info(fmt "\n", ##arg); \

Просмотреть файл

@ -534,7 +534,7 @@ int smsdvb_debugfs_register(void)
*/ */
d = debugfs_create_dir("smsdvb", usb_debug_root); d = debugfs_create_dir("smsdvb", usb_debug_root);
if (IS_ERR_OR_NULL(d)) { if (IS_ERR_OR_NULL(d)) {
sms_err("Couldn't create sysfs node for smsdvb"); pr_err("Couldn't create sysfs node for smsdvb\n");
return PTR_ERR(d); return PTR_ERR(d);
} else { } else {
smsdvb_debugfs_usb_root = d; smsdvb_debugfs_usb_root = d;

Просмотреть файл

@ -124,7 +124,7 @@ static void sms_board_dvb3_event(struct smsdvb_client_t *client,
break; break;
default: default:
sms_err("Unknown dvb3 api event"); pr_err("Unknown dvb3 api event\n");
break; break;
} }
} }
@ -1097,10 +1097,8 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev,
if (!arrival) if (!arrival)
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_err("kmalloc() failed");
return -ENOMEM; return -ENOMEM;
}
/* register dvb adapter */ /* register dvb adapter */
rc = dvb_register_adapter(&client->adapter, rc = dvb_register_adapter(&client->adapter,
@ -1108,7 +1106,7 @@ static 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("dvb_register_adapter() failed %d", rc); pr_err("dvb_register_adapter() failed %d\n", rc);
goto adapter_error; goto adapter_error;
} }
#ifdef CONFIG_MEDIA_CONTROLLER_DVB #ifdef CONFIG_MEDIA_CONTROLLER_DVB
@ -1124,7 +1122,7 @@ static 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("dvb_dmx_init failed %d", rc); pr_err("dvb_dmx_init failed %d\n", rc);
goto dvbdmx_error; goto dvbdmx_error;
} }
@ -1135,7 +1133,7 @@ static 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("dvb_dmxdev_init failed %d", rc); pr_err("dvb_dmxdev_init failed %d\n", rc);
goto dmxdev_error; goto dmxdev_error;
} }
@ -1156,7 +1154,7 @@ static 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("frontend registration failed %d", rc); pr_err("frontend registration failed %d\n", rc);
goto frontend_error; goto frontend_error;
} }
@ -1168,7 +1166,7 @@ static 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_err("smscore_register_client() failed %d", rc); pr_err("smscore_register_client() failed %d\n", rc);
goto client_error; goto client_error;
} }

Просмотреть файл

@ -59,10 +59,8 @@ int sms_ir_init(struct smscore_device_t *coredev)
sms_log("Allocating rc device"); sms_log("Allocating rc device");
dev = rc_allocate_device(); dev = rc_allocate_device();
if (!dev) { if (!dev)
sms_err("Not enough memory");
return -ENOMEM; return -ENOMEM;
}
coredev->ir.controller = 0; /* Todo: vega/nova SPI number */ coredev->ir.controller = 0; /* Todo: vega/nova SPI number */
coredev->ir.timeout = IR_DEFAULT_TIMEOUT; coredev->ir.timeout = IR_DEFAULT_TIMEOUT;
@ -97,7 +95,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
err = rc_register_device(dev); err = rc_register_device(dev);
if (err < 0) { if (err < 0) {
sms_err("Failed to register device"); pr_err("Failed to register device\n");
rc_free_device(dev); rc_free_device(dev);
return err; return err;
} }

Просмотреть файл

@ -142,14 +142,14 @@ static void smssdio_interrupt(struct sdio_func *func)
*/ */
(void)sdio_readb(func, SMSSDIO_INT, &ret); (void)sdio_readb(func, SMSSDIO_INT, &ret);
if (ret) { if (ret) {
sms_err("Unable to read interrupt register!\n"); pr_err("Unable to read interrupt register!\n");
return; return;
} }
if (smsdev->split_cb == NULL) { if (smsdev->split_cb == NULL) {
cb = smscore_getbuffer(smsdev->coredev); cb = smscore_getbuffer(smsdev->coredev);
if (!cb) { if (!cb) {
sms_err("Unable to allocate data buffer!\n"); pr_err("Unable to allocate data buffer!\n");
return; return;
} }
@ -158,7 +158,7 @@ static void smssdio_interrupt(struct sdio_func *func)
SMSSDIO_DATA, SMSSDIO_DATA,
SMSSDIO_BLOCK_SIZE); SMSSDIO_BLOCK_SIZE);
if (ret) { if (ret) {
sms_err("Error %d reading initial block!\n", ret); pr_err("Error %d reading initial block!\n", ret);
return; return;
} }
@ -199,7 +199,7 @@ static void smssdio_interrupt(struct sdio_func *func)
size); size);
if (ret && ret != -EINVAL) { if (ret && ret != -EINVAL) {
smscore_putbuffer(smsdev->coredev, cb); smscore_putbuffer(smsdev->coredev, cb);
sms_err("Error %d reading data from card!\n", ret); pr_err("Error %d reading data from card!\n", ret);
return; return;
} }
@ -217,8 +217,8 @@ static void smssdio_interrupt(struct sdio_func *func)
smsdev->func->cur_blksize); smsdev->func->cur_blksize);
if (ret) { if (ret) {
smscore_putbuffer(smsdev->coredev, cb); smscore_putbuffer(smsdev->coredev, cb);
sms_err("Error %d reading " pr_err("Error %d reading data from card!\n",
"data from card!\n", ret); ret);
return; return;
} }

Просмотреть файл

@ -88,7 +88,7 @@ static void smsusb_onresponse(struct urb *urb)
struct smsusb_device_t *dev = surb->dev; struct smsusb_device_t *dev = surb->dev;
if (urb->status == -ESHUTDOWN) { if (urb->status == -ESHUTDOWN) {
sms_err("error, urb status %d (-ESHUTDOWN), %d bytes", pr_err("error, urb status %d (-ESHUTDOWN), %d bytes\n",
urb->status, urb->actual_length); urb->status, urb->actual_length);
return; return;
} }
@ -110,9 +110,7 @@ static void smsusb_onresponse(struct urb *urb)
/* sanity check */ /* sanity check */
if (((int) phdr->msg_length + if (((int) phdr->msg_length +
surb->cb->offset) > urb->actual_length) { surb->cb->offset) > urb->actual_length) {
sms_err("invalid response " pr_err("invalid response msglen %d offset %d size %d\n",
"msglen %d offset %d "
"size %d",
phdr->msg_length, phdr->msg_length,
surb->cb->offset, surb->cb->offset,
urb->actual_length); urb->actual_length);
@ -135,12 +133,11 @@ static 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_err("invalid response " pr_err("invalid response msglen %d actual %d\n",
"msglen %d actual %d",
phdr->msg_length, urb->actual_length); phdr->msg_length, urb->actual_length);
} }
} else } else
sms_err("error, urb status %d, %d bytes", pr_err("error, urb status %d, %d bytes\n",
urb->status, urb->actual_length); urb->status, urb->actual_length);
@ -154,7 +151,7 @@ static int smsusb_submit_urb(struct smsusb_device_t *dev,
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_err("smscore_getbuffer(...) returned NULL"); pr_err("smscore_getbuffer(...) returned NULL\n");
return -ENOMEM; return -ENOMEM;
} }
} }
@ -195,7 +192,7 @@ static 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_err("smsusb_submit_urb(...) failed"); pr_err("smsusb_submit_urb(...) failed\n");
smsusb_stop_streaming(dev); smsusb_stop_streaming(dev);
break; break;
} }
@ -250,7 +247,7 @@ static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id)
id = sms_get_board(board_id)->default_mode; id = sms_get_board(board_id)->default_mode;
if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) { if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
sms_err("invalid firmware id specified %d", id); pr_err("invalid firmware id specified %d\n", id);
return -EINVAL; return -EINVAL;
} }
@ -282,7 +279,7 @@ static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id)
kfree(fw_buffer); kfree(fw_buffer);
} else { } else {
sms_err("failed to allocate firmware buffer"); pr_err("failed to allocate firmware buffer\n");
rc = -ENOMEM; rc = -ENOMEM;
} }
sms_info("read FW %s, size=%zu", fw_filename, fw->size); sms_info("read FW %s, size=%zu", fw_filename, fw->size);
@ -301,7 +298,7 @@ static void smsusb1_detectmode(void *context, int *mode)
if (!product_string) { if (!product_string) {
product_string = "none"; product_string = "none";
sms_err("product string not found"); pr_err("product string not found\n");
} 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"))
@ -320,7 +317,7 @@ static int smsusb1_setmode(void *context, int mode)
sizeof(struct sms_msg_hdr), 0 }; sizeof(struct sms_msg_hdr), 0 };
if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
sms_err("invalid firmware id specified %d", mode); pr_err("invalid firmware id specified %d\n", mode);
return -EINVAL; return -EINVAL;
} }
@ -370,7 +367,7 @@ static void siano_media_device_register(struct smsusb_device_t *dev)
ret = media_device_register(mdev); ret = media_device_register(mdev);
if (ret) { if (ret) {
sms_err("Couldn't create a media device. Error: %d\n", pr_err("Couldn't create a media device. Error: %d\n",
ret); ret);
kfree(mdev); kfree(mdev);
return; return;
@ -391,10 +388,8 @@ static 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_err("kzalloc(sizeof(struct smsusb_device_t) failed");
return -ENOMEM; return -ENOMEM;
}
memset(&params, 0, sizeof(params)); memset(&params, 0, sizeof(params));
usb_set_intfdata(intf, dev); usb_set_intfdata(intf, dev);
@ -411,7 +406,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
params.detectmode_handler = smsusb1_detectmode; params.detectmode_handler = smsusb1_detectmode;
break; break;
case SMS_UNKNOWN_TYPE: case SMS_UNKNOWN_TYPE:
sms_err("Unspecified sms device type!"); pr_err("Unspecified sms device type!\n");
/* fall-thru */ /* fall-thru */
default: default:
dev->buffer_size = USB2_BUFFER_SIZE; dev->buffer_size = USB2_BUFFER_SIZE;
@ -443,7 +438,7 @@ static 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_err("smscore_register_device(...) failed, rc %d", rc); pr_err("smscore_register_device(...) failed, rc %d\n", rc);
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
@ -461,7 +456,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
sms_info("smsusb_start_streaming(...)."); sms_info("smsusb_start_streaming(...).");
rc = smsusb_start_streaming(dev); rc = smsusb_start_streaming(dev);
if (rc < 0) { if (rc < 0) {
sms_err("smsusb_start_streaming(...) failed"); pr_err("smsusb_start_streaming(...) failed\n");
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
@ -470,7 +465,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
rc = smscore_start_device(dev->coredev); rc = smscore_start_device(dev->coredev);
if (rc < 0) { if (rc < 0) {
sms_err("smscore_start_device(...) failed"); pr_err("smscore_start_device(...) failed\n");
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
@ -505,7 +500,7 @@ static int smsusb_probe(struct usb_interface *intf,
intf->cur_altsetting->desc.bInterfaceNumber, intf->cur_altsetting->desc.bInterfaceNumber,
0); 0);
if (rc < 0) { if (rc < 0) {
sms_err("usb_set_interface failed, rc %d", rc); pr_err("usb_set_interface failed, rc %d\n", rc);
return rc; return rc;
} }
} }
@ -545,7 +540,8 @@ static int smsusb_probe(struct usb_interface *intf,
if (!rc) if (!rc)
sms_info("stellar device now in warm state"); sms_info("stellar device now in warm state");
else else
sms_err("Failed to put stellar in warm state. Error: %d", rc); pr_err("Failed to put stellar in warm state. Error: %d\n",
rc);
return rc; return rc;
} else { } else {