aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/siano/smsusb.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-06-19 21:07:23 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:22:48 -0400
commiteb250942fe3cf2a129ab55d65161bc66b7009853 (patch)
treedd0cf00e7cd8f69b42bbc63b3ac59a3208e112d1 /drivers/media/dvb/siano/smsusb.c
parentf14d56a99bddb779f6f7ec028bcd9d142536589e (diff)
V4L/DVB (8296): sms1xxx: always show error messages
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/siano/smsusb.c')
-rw-r--r--drivers/media/dvb/siano/smsusb.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index 01f5c74c41e9..221b024e9d83 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("error, urb status %d, %d bytes", 63 sms_err("error, urb status %d, %d bytes",
64 urb->status, urb->actual_length); 64 urb->status, urb->actual_length);
65 return; 65 return;
66 } 66 }
67 67
@@ -81,12 +81,12 @@ 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("invalid response " 84 sms_err("invalid response "
85 "msglen %d offset %d " 85 "msglen %d offset %d "
86 "size %d", 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);
90 goto exit_and_resubmit; 90 goto exit_and_resubmit;
91 } 91 }
92 92
@@ -100,9 +100,9 @@ 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("invalid response " 103 sms_err("invalid response "
104 "msglen %d actual %d", 104 "msglen %d actual %d",
105 phdr->msgLength, urb->actual_length); 105 phdr->msgLength, urb->actual_length);
106 } 106 }
107 } 107 }
108 108
@@ -115,8 +115,7 @@ 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("smscore_getbuffer(...) " 118 sms_err("smscore_getbuffer(...) returned NULL");
119 "returned NULL");
120 return -ENOMEM; 119 return -ENOMEM;
121 } 120 }
122 } 121 }
@@ -157,8 +156,7 @@ int smsusb_start_streaming(struct smsusb_device_t *dev)
157 for (i = 0; i < MAX_URBS; i++) { 156 for (i = 0; i < MAX_URBS; i++) {
158 rc = smsusb_submit_urb(dev, &dev->surbs[i]); 157 rc = smsusb_submit_urb(dev, &dev->surbs[i]);
159 if (rc < 0) { 158 if (rc < 0) {
160 sms_info("smsusb_submit_urb(...) " 159 sms_err("smsusb_submit_urb(...) failed");
161 "failed");
162 smsusb_stop_streaming(dev); 160 smsusb_stop_streaming(dev);
163 break; 161 break;
164 } 162 }
@@ -191,14 +189,14 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
191 int rc, dummy; 189 int rc, dummy;
192 190
193 if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) { 191 if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
194 sms_info("invalid firmware id specified %d", id); 192 sms_err("invalid firmware id specified %d", id);
195 return -EINVAL; 193 return -EINVAL;
196 } 194 }
197 195
198 rc = request_firmware(&fw, smsusb1_fw_lkup[id], &udev->dev); 196 rc = request_firmware(&fw, smsusb1_fw_lkup[id], &udev->dev);
199 if (rc < 0) { 197 if (rc < 0) {
200 sms_info("failed to open \"%s\" mode %d", 198 sms_err("failed to open \"%s\" mode %d",
201 smsusb1_fw_lkup[id], id); 199 smsusb1_fw_lkup[id], id);
202 return rc; 200 return rc;
203 } 201 }
204 202
@@ -213,7 +211,7 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
213 211
214 kfree(fw_buffer); 212 kfree(fw_buffer);
215 } else { 213 } else {
216 sms_info("failed to allocate firmware buffer"); 214 sms_err("failed to allocate firmware buffer");
217 rc = -ENOMEM; 215 rc = -ENOMEM;
218 } 216 }
219 217
@@ -250,7 +248,7 @@ int smsusb1_setmode(void *context, int mode)
250 sizeof(struct SmsMsgHdr_ST), 0 }; 248 sizeof(struct SmsMsgHdr_ST), 0 };
251 249
252 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { 250 if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
253 sms_info("invalid firmware id specified %d", mode); 251 sms_err("invalid firmware id specified %d", mode);
254 return -EINVAL; 252 return -EINVAL;
255 } 253 }
256 254
@@ -287,8 +285,7 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
287 /* create device object */ 285 /* create device object */
288 dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL); 286 dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
289 if (!dev) { 287 if (!dev) {
290 sms_info("kzalloc(sizeof(struct smsusb_device_t) " 288 sms_err("kzalloc(sizeof(struct smsusb_device_t) failed");
291 "failed");
292 return -ENOMEM; 289 return -ENOMEM;
293 } 290 }
294 291
@@ -346,8 +343,7 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
346 /* register in smscore */ 343 /* register in smscore */
347 rc = smscore_register_device(&params, &dev->coredev); 344 rc = smscore_register_device(&params, &dev->coredev);
348 if (rc < 0) { 345 if (rc < 0) {
349 sms_info("smscore_register_device(...) failed, " 346 sms_err("smscore_register_device(...) failed, rc %d", rc);
350 "rc %d", rc);
351 smsusb_term_device(intf); 347 smsusb_term_device(intf);
352 return rc; 348 return rc;
353 } 349 }
@@ -363,14 +359,14 @@ int smsusb_init_device(struct usb_interface *intf, int board_id)
363 sms_info("smsusb_start_streaming(...)."); 359 sms_info("smsusb_start_streaming(...).");
364 rc = smsusb_start_streaming(dev); 360 rc = smsusb_start_streaming(dev);
365 if (rc < 0) { 361 if (rc < 0) {
366 sms_info("smsusb_start_streaming(...) failed"); 362 sms_err("smsusb_start_streaming(...) failed");
367 smsusb_term_device(intf); 363 smsusb_term_device(intf);
368 return rc; 364 return rc;
369 } 365 }
370 366
371 rc = smscore_start_device(dev->coredev); 367 rc = smscore_start_device(dev->coredev);
372 if (rc < 0) { 368 if (rc < 0) {
373 sms_info("smscore_start_device(...) failed"); 369 sms_err("smscore_start_device(...) failed");
374 smsusb_term_device(intf); 370 smsusb_term_device(intf);
375 return rc; 371 return rc;
376 } 372 }
@@ -393,8 +389,7 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
393 rc = usb_set_interface( 389 rc = usb_set_interface(
394 udev, intf->cur_altsetting->desc.bInterfaceNumber, 0); 390 udev, intf->cur_altsetting->desc.bInterfaceNumber, 0);
395 if (rc < 0) { 391 if (rc < 0) {
396 sms_info("usb_set_interface failed, " 392 sms_err("usb_set_interface failed, rc %d", rc);
397 "rc %d", rc);
398 return rc; 393 return rc;
399 } 394 }
400 } 395 }
@@ -409,7 +404,7 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
409 404
410 if ((udev->actconfig->desc.bNumInterfaces == 2) && 405 if ((udev->actconfig->desc.bNumInterfaces == 2) &&
411 (intf->cur_altsetting->desc.bInterfaceNumber == 0)) { 406 (intf->cur_altsetting->desc.bInterfaceNumber == 0)) {
412 sms_info("rom interface 0 is not used"); 407 sms_err("rom interface 0 is not used");
413 return -ENODEV; 408 return -ENODEV;
414 } 409 }
415 410
@@ -442,7 +437,7 @@ int smsusb_register(void)
442{ 437{
443 int rc = usb_register(&smsusb_driver); 438 int rc = usb_register(&smsusb_driver);
444 if (rc) 439 if (rc)
445 sms_info("usb_register failed. Error number %d", rc); 440 sms_err("usb_register failed. Error number %d", rc);
446 441
447 sms_debug(""); 442 sms_debug("");
448 443