diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-22 11:04:35 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-26 09:10:02 -0300 |
commit | 5ed0a2c7eca3265e6df3e9eebedfc2db3916dcd4 (patch) | |
tree | 1384a26bb11cc3521705dc760012fe279a055d1b /drivers/media/common/siano | |
parent | 535bd1e96e6ea5eedd1171f0d4a7750597bb4cbf (diff) |
[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>
Diffstat (limited to 'drivers/media/common/siano')
-rw-r--r-- | drivers/media/common/siano/sms-cards.c | 2 | ||||
-rw-r--r-- | drivers/media/common/siano/smscoreapi.c | 67 | ||||
-rw-r--r-- | drivers/media/common/siano/smscoreapi.h | 1 | ||||
-rw-r--r-- | drivers/media/common/siano/smsdvb-debugfs.c | 2 | ||||
-rw-r--r-- | drivers/media/common/siano/smsdvb-main.c | 16 | ||||
-rw-r--r-- | drivers/media/common/siano/smsir.c | 6 |
6 files changed, 44 insertions, 50 deletions
diff --git a/drivers/media/common/siano/sms-cards.c b/drivers/media/common/siano/sms-cards.c index 82c7a1289f05..9c7a9452c04c 100644 --- a/drivers/media/common/siano/sms-cards.c +++ b/drivers/media/common/siano/sms-cards.c @@ -232,7 +232,7 @@ int sms_board_event(struct smscore_device_t *coredev, break; /* BOARD_EVENT_MULTIPLEX_ERRORS */ default: - sms_err("Unknown SMS board event"); + pr_err("Unknown SMS board event\n"); break; } return 0; diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 26dc4392c3e1..1f99698a211e 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c @@ -461,7 +461,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) strcpy(entry->devpath, devpath); list_add(&entry->entry, &g_smscore_registry); } else - sms_err("failed to create smscore_registry."); + pr_err("failed to create smscore_registry.\n"); kmutex_unlock(&g_smscore_registrylock); return entry; } @@ -474,7 +474,7 @@ int smscore_registry_getmode(char *devpath) if (entry) return entry->mode; else - sms_err("No registry found."); + pr_err("No registry found.\n"); return default_mode; } @@ -488,7 +488,7 @@ static enum sms_device_type_st smscore_registry_gettype(char *devpath) if (entry) return entry->type; else - sms_err("No registry found."); + pr_err("No registry found.\n"); return -EINVAL; } @@ -501,7 +501,7 @@ static void smscore_registry_setmode(char *devpath, int mode) if (entry) entry->mode = mode; else - sms_err("No registry found."); + pr_err("No registry found.\n"); } static void smscore_registry_settype(char *devpath, @@ -513,7 +513,7 @@ static void smscore_registry_settype(char *devpath, if (entry) entry->type = type; 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); if (rc != 0) - sms_err("Error initialization DTV IR sub-module"); + pr_err("Error initialization DTV IR sub-module\n"); else { buffer = kmalloc(sizeof(struct sms_msg_data2) + SMS_DMA_ALIGNMENT, @@ -813,8 +813,7 @@ static int smscore_init_ir(struct smscore_device_t *coredev) kfree(buffer); } else - sms_err - ("Sending IR initialization message failed"); + pr_err("Sending IR initialization message failed\n"); } } else 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); if (!board) { - sms_err("no board configuration exist."); + pr_err("no board configuration exist.\n"); return -EINVAL; } @@ -949,7 +948,7 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev, msg->x_msg_header.msg_length, &coredev->reload_start_done); if (rc < 0) { - sms_err("device reload failed, rc %d", rc); + pr_err("device reload failed, rc %d\n", rc); goto exit_fw_download; } 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); 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; } 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); 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; } sms_info("read fw %s, buffer size=0x%zx", fw_filename, fw->size); fw_buf = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT), GFP_KERNEL | GFP_DMA); if (!fw_buf) { - sms_err("failed to allocate firmware buffer"); + pr_err("failed to allocate firmware buffer\n"); rc = -ENOMEM; } else { 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, &coredev->version_ex_done); 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, msecs_to_jiffies(5000))) { @@ -1280,7 +1279,7 @@ static int smscore_detect_mode(struct smscore_device_t *coredev) coredev, msg, msg->msg_length, &coredev->version_ex_done); 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); } else 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) + SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); 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; } @@ -1343,7 +1342,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) sms_debug("set device mode to %d", mode); if (coredev->device_flags & SMS_DEVICE_FAMILY2) { 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; } @@ -1352,7 +1351,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) { rc = smscore_detect_mode(coredev); if (rc < 0) { - sms_err("mode detect failed %d", rc); + pr_err("mode detect failed %d\n", rc); return rc; } } @@ -1374,11 +1373,11 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) if (coredev->fw_version >= 0x800) { rc = smscore_init_device(coredev, mode); if (rc < 0) - sms_err("device init failed, rc %d.", rc); + pr_err("device init failed, rc %d.\n", rc); } } else { 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; } @@ -1415,7 +1414,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) } if (rc < 0) - sms_err("return error code %d.", rc); + pr_err("return error code %d.\n", rc); else 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; if (!client) { - sms_err("bad parameter."); + pr_err("bad parameter.\n"); return -EINVAL; } 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; 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; } listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); if (!listentry) { - sms_err("Can't allocate memory for client id."); + pr_err("Can't allocate memory for client id.\n"); return -ENOMEM; } 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 */ if (smscore_find_client(coredev, params->data_type, params->initial_id)) { - sms_err("Client already exist."); + pr_err("Client already exist.\n"); return -EEXIST; } newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); if (!newclient) { - sms_err("Failed to allocate memory for client."); + pr_err("Failed to allocate memory for client.\n"); return -ENOMEM; } @@ -1804,7 +1803,7 @@ int smsclient_sendrequest(struct smscore_client_t *client, int rc; if (client == NULL) { - sms_err("Got NULL client"); + pr_err("Got NULL client\n"); return -EINVAL; } @@ -1812,7 +1811,7 @@ int smsclient_sendrequest(struct smscore_client_t *client, /* check that no other channel with same id exists */ if (coredev == NULL) { - sms_err("Got NULL coredev"); + pr_err("Got NULL coredev\n"); return -EINVAL; } @@ -2017,9 +2016,9 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 pin_num, if (rc != 0) { if (rc == -ETIME) - sms_err("smscore_gpio_configure timeout"); + pr_err("smscore_gpio_configure timeout\n"); else - sms_err("smscore_gpio_configure error"); + pr_err("smscore_gpio_configure error\n"); } free: kfree(buffer); @@ -2066,9 +2065,9 @@ int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 pin_num, if (rc != 0) { if (rc == -ETIME) - sms_err("smscore_gpio_set_level timeout"); + pr_err("smscore_gpio_set_level timeout\n"); else - sms_err("smscore_gpio_set_level error"); + pr_err("smscore_gpio_set_level error\n"); } kfree(buffer); @@ -2114,9 +2113,9 @@ int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 pin_num, if (rc != 0) { if (rc == -ETIME) - sms_err("smscore_gpio_get_level timeout"); + pr_err("smscore_gpio_get_level timeout\n"); else - sms_err("smscore_gpio_get_level error"); + pr_err("smscore_gpio_get_level error\n"); } kfree(buffer); diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index 13bd7ef7a588..9ea6a10757d5 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h @@ -1180,7 +1180,6 @@ int smscore_led_state(struct smscore_device_t *core, int led); #define DBG_ADV 2 #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 {\ if (sms_dbg & DBG_INFO) \ pr_info(fmt "\n", ##arg); \ diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c index c3e1a404e4f6..1a8677ade391 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -534,7 +534,7 @@ int smsdvb_debugfs_register(void) */ d = debugfs_create_dir("smsdvb", usb_debug_root); 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); } else { smsdvb_debugfs_usb_root = d; diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index 6eb1b14092cb..a8538d00dfc7 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -124,7 +124,7 @@ static void sms_board_dvb3_event(struct smsdvb_client_t *client, break; default: - sms_err("Unknown dvb3 api event"); + pr_err("Unknown dvb3 api event\n"); break; } } @@ -1097,10 +1097,8 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, if (!arrival) return 0; client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); - if (!client) { - sms_err("kmalloc() failed"); + if (!client) return -ENOMEM; - } /* register dvb 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, THIS_MODULE, device, adapter_nr); if (rc < 0) { - sms_err("dvb_register_adapter() failed %d", rc); + pr_err("dvb_register_adapter() failed %d\n", rc); goto adapter_error; } #ifdef CONFIG_MEDIA_CONTROLLER_DVB @@ -1124,7 +1122,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, rc = dvb_dmx_init(&client->demux); if (rc < 0) { - sms_err("dvb_dmx_init failed %d", rc); + pr_err("dvb_dmx_init failed %d\n", rc); goto dvbdmx_error; } @@ -1135,7 +1133,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter); if (rc < 0) { - sms_err("dvb_dmxdev_init failed %d", rc); + pr_err("dvb_dmxdev_init failed %d\n", rc); goto dmxdev_error; } @@ -1156,7 +1154,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, rc = dvb_register_frontend(&client->adapter, &client->frontend); if (rc < 0) { - sms_err("frontend registration failed %d", rc); + pr_err("frontend registration failed %d\n", rc); goto frontend_error; } @@ -1168,7 +1166,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, rc = smscore_register_client(coredev, ¶ms, &client->smsclient); if (rc < 0) { - sms_err("smscore_register_client() failed %d", rc); + pr_err("smscore_register_client() failed %d\n", rc); goto client_error; } diff --git a/drivers/media/common/siano/smsir.c b/drivers/media/common/siano/smsir.c index 2dcae6ace282..2e0f96ff5594 100644 --- a/drivers/media/common/siano/smsir.c +++ b/drivers/media/common/siano/smsir.c @@ -59,10 +59,8 @@ int sms_ir_init(struct smscore_device_t *coredev) sms_log("Allocating rc device"); dev = rc_allocate_device(); - if (!dev) { - sms_err("Not enough memory"); + if (!dev) return -ENOMEM; - } coredev->ir.controller = 0; /* Todo: vega/nova SPI number */ coredev->ir.timeout = IR_DEFAULT_TIMEOUT; @@ -97,7 +95,7 @@ int sms_ir_init(struct smscore_device_t *coredev) err = rc_register_device(dev); if (err < 0) { - sms_err("Failed to register device"); + pr_err("Failed to register device\n"); rc_free_device(dev); return err; } |