aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/siano/smsusb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-22 09:04:35 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-26 07:10:02 -0500
commit5ed0a2c7eca3265e6df3e9eebedfc2db3916dcd4 (patch)
tree1384a26bb11cc3521705dc760012fe279a055d1b /drivers/media/usb/siano/smsusb.c
parent535bd1e96e6ea5eedd1171f0d4a7750597bb4cbf (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/usb/siano/smsusb.c')
-rw-r--r--drivers/media/usb/siano/smsusb.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 244674599878..13fff095218a 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -88,7 +88,7 @@ static void smsusb_onresponse(struct urb *urb)
88 struct smsusb_device_t *dev = surb->dev; 88 struct smsusb_device_t *dev = surb->dev;
89 89
90 if (urb->status == -ESHUTDOWN) { 90 if (urb->status == -ESHUTDOWN) {
91 sms_err("error, urb status %d (-ESHUTDOWN), %d bytes", 91 pr_err("error, urb status %d (-ESHUTDOWN), %d bytes\n",
92 urb->status, urb->actual_length); 92 urb->status, urb->actual_length);
93 return; 93 return;
94 } 94 }
@@ -110,9 +110,7 @@ static void smsusb_onresponse(struct urb *urb)
110 /* sanity check */ 110 /* sanity check */
111 if (((int) phdr->msg_length + 111 if (((int) phdr->msg_length +
112 surb->cb->offset) > urb->actual_length) { 112 surb->cb->offset) > urb->actual_length) {
113 sms_err("invalid response " 113 pr_err("invalid response msglen %d offset %d size %d\n",
114 "msglen %d offset %d "
115 "size %d",
116 phdr->msg_length, 114 phdr->msg_length,
117 surb->cb->offset, 115 surb->cb->offset,
118 urb->actual_length); 116 urb->actual_length);
@@ -135,12 +133,11 @@ static void smsusb_onresponse(struct urb *urb)
135 smscore_onresponse(dev->coredev, surb->cb); 133 smscore_onresponse(dev->coredev, surb->cb);
136 surb->cb = NULL; 134 surb->cb = NULL;
137 } else { 135 } else {
138 sms_err("invalid response " 136 pr_err("invalid response msglen %d actual %d\n",
139 "msglen %d actual %d",
140 phdr->msg_length, urb->actual_length); 137 phdr->msg_length, urb->actual_length);
141 } 138 }
142 } else 139 } else
143 sms_err("error, urb status %d, %d bytes", 140 pr_err("error, urb status %d, %d bytes\n",
144 urb->status, urb->actual_length); 141 urb->status, urb->actual_length);
145 142
146 143
@@ -154,7 +151,7 @@ static int smsusb_submit_urb(struct smsusb_device_t *dev,
154 if (!surb->cb) { 151 if (!surb->cb) {
155 surb->cb = smscore_getbuffer(dev->coredev); 152 surb->cb = smscore_getbuffer(dev->coredev);
156 if (!surb->cb) { 153 if (!surb->cb) {
157 sms_err("smscore_getbuffer(...) returned NULL"); 154 pr_err("smscore_getbuffer(...) returned NULL\n");
158 return -ENOMEM; 155 return -ENOMEM;
159 } 156 }
160 } 157 }
@@ -195,7 +192,7 @@ static int smsusb_start_streaming(struct smsusb_device_t *dev)
195 for (i = 0; i < MAX_URBS; i++) { 192 for (i = 0; i < MAX_URBS; i++) {
196 rc = smsusb_submit_urb(dev, &dev->surbs[i]); 193 rc = smsusb_submit_urb(dev, &dev->surbs[i]);
197 if (rc < 0) { 194 if (rc < 0) {
198 sms_err("smsusb_submit_urb(...) failed"); 195 pr_err("smsusb_submit_urb(...) failed\n");
199 smsusb_stop_streaming(dev); 196 smsusb_stop_streaming(dev);
200 break; 197 break;
201 } 198 }
@@ -250,7 +247,7 @@ static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id)
250 id = sms_get_board(board_id)->default_mode; 247 id = sms_get_board(board_id)->default_mode;
251 248
252 if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) { 249 if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
253 sms_err("invalid firmware id specified %d", id); 250 pr_err("invalid firmware id specified %d\n", id);
254 return -EINVAL; 251 return -EINVAL;
255 } 252 }
256 253
@@ -282,7 +279,7 @@ static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id)
282 279
283 kfree(fw_buffer); 280 kfree(fw_buffer);
284 } else { 281 } else {
285 sms_err("failed to allocate firmware buffer"); 282 pr_err("failed to allocate firmware buffer\n");
286 rc = -ENOMEM; 283 rc = -ENOMEM;
287 } 284 }
288 sms_info("read FW %s, size=%zu", fw_filename, fw->size); 285 sms_info("read FW %s, size=%zu", fw_filename, fw->size);
@@ -301,7 +298,7 @@ static void smsusb1_detectmode(void *context, int *mode)
301 298
302 if (!product_string) { 299 if (!product_string) {
303 product_string = "none"; 300 product_string = "none";
304 sms_err("product string not found"); 301 pr_err("product string not found\n");
305 } else if (strstr(product_string, "DVBH")) 302 } else if (strstr(product_string, "DVBH"))
306 *mode = 1; 303 *mode = 1;
307 else if (strstr(product_string, "BDA")) 304 else if (strstr(product_string, "BDA"))
@@ -320,7 +317,7 @@ static int smsusb1_setmode(void *context, int mode)
320 sizeof(struct sms_msg_hdr), 0 }; 317 sizeof(struct sms_msg_hdr), 0 };
321 318
322 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { 319 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
323 sms_err("invalid firmware id specified %d", mode); 320 pr_err("invalid firmware id specified %d\n", mode);
324 return -EINVAL; 321 return -EINVAL;
325 } 322 }
326 323
@@ -370,7 +367,7 @@ static void siano_media_device_register(struct smsusb_device_t *dev)
370 367
371 ret = media_device_register(mdev); 368 ret = media_device_register(mdev);
372 if (ret) { 369 if (ret) {
373 sms_err("Couldn't create a media device. Error: %d\n", 370 pr_err("Couldn't create a media device. Error: %d\n",
374 ret); 371 ret);
375 kfree(mdev); 372 kfree(mdev);
376 return; 373 return;
@@ -391,10 +388,8 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
391 388
392 /* create device object */ 389 /* create device object */
393 dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); 390 dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
394 if (!dev) { 391 if (!dev)
395 sms_err("kzalloc(sizeof(struct smsusb_device_t) failed");
396 return -ENOMEM; 392 return -ENOMEM;
397 }
398 393
399 memset(&params, 0, sizeof(params)); 394 memset(&params, 0, sizeof(params));
400 usb_set_intfdata(intf, dev); 395 usb_set_intfdata(intf, dev);
@@ -411,7 +406,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
411 params.detectmode_handler = smsusb1_detectmode; 406 params.detectmode_handler = smsusb1_detectmode;
412 break; 407 break;
413 case SMS_UNKNOWN_TYPE: 408 case SMS_UNKNOWN_TYPE:
414 sms_err("Unspecified sms device type!"); 409 pr_err("Unspecified sms device type!\n");
415 /* fall-thru */ 410 /* fall-thru */
416 default: 411 default:
417 dev->buffer_size = USB2_BUFFER_SIZE; 412 dev->buffer_size = USB2_BUFFER_SIZE;
@@ -443,7 +438,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
443 /* register in smscore */ 438 /* register in smscore */
444 rc = smscore_register_device(&params, &dev->coredev); 439 rc = smscore_register_device(&params, &dev->coredev);
445 if (rc < 0) { 440 if (rc < 0) {
446 sms_err("smscore_register_device(...) failed, rc %d", rc); 441 pr_err("smscore_register_device(...) failed, rc %d\n", rc);
447 smsusb_term_device(intf); 442 smsusb_term_device(intf);
448 return rc; 443 return rc;
449 } 444 }
@@ -461,7 +456,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
461 sms_info("smsusb_start_streaming(...)."); 456 sms_info("smsusb_start_streaming(...).");
462 rc = smsusb_start_streaming(dev); 457 rc = smsusb_start_streaming(dev);
463 if (rc < 0) { 458 if (rc < 0) {
464 sms_err("smsusb_start_streaming(...) failed"); 459 pr_err("smsusb_start_streaming(...) failed\n");
465 smsusb_term_device(intf); 460 smsusb_term_device(intf);
466 return rc; 461 return rc;
467 } 462 }
@@ -470,7 +465,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
470 465
471 rc = smscore_start_device(dev->coredev); 466 rc = smscore_start_device(dev->coredev);
472 if (rc < 0) { 467 if (rc < 0) {
473 sms_err("smscore_start_device(...) failed"); 468 pr_err("smscore_start_device(...) failed\n");
474 smsusb_term_device(intf); 469 smsusb_term_device(intf);
475 return rc; 470 return rc;
476 } 471 }
@@ -505,7 +500,7 @@ static int smsusb_probe(struct usb_interface *intf,
505 intf->cur_altsetting->desc.bInterfaceNumber, 500 intf->cur_altsetting->desc.bInterfaceNumber,
506 0); 501 0);
507 if (rc < 0) { 502 if (rc < 0) {
508 sms_err("usb_set_interface failed, rc %d", rc); 503 pr_err("usb_set_interface failed, rc %d\n", rc);
509 return rc; 504 return rc;
510 } 505 }
511 } 506 }
@@ -545,7 +540,8 @@ static int smsusb_probe(struct usb_interface *intf,
545 if (!rc) 540 if (!rc)
546 sms_info("stellar device now in warm state"); 541 sms_info("stellar device now in warm state");
547 else 542 else
548 sms_err("Failed to put stellar in warm state. Error: %d", rc); 543 pr_err("Failed to put stellar in warm state. Error: %d\n",
544 rc);
549 545
550 return rc; 546 return rc;
551 } else { 547 } else {