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>
This commit is contained in:
Michael Krufky 2008-06-19 22:07:23 -03:00 коммит произвёл Mauro Carvalho Chehab
Родитель f14d56a99b
Коммит eb250942fe
3 изменённых файлов: 37 добавлений и 43 удалений

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

@ -777,7 +777,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
PDEBUG("set device mode to %d", 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("invalid mode specified %d", mode); sms_err("invalid mode specified %d", mode);
return -EINVAL; return -EINVAL;
} }
@ -786,7 +786,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_info("mode detect failed %d", rc); sms_err("mode detect failed %d", rc);
return rc; return rc;
} }
} }
@ -801,8 +801,7 @@ 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("load firmware " sms_err("load firmware failed %d", rc);
"failed %d", rc);
return rc; return rc;
} }
} else } else
@ -826,13 +825,13 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
kfree(buffer); kfree(buffer);
} else { } else {
sms_info("Could not allocate buffer for " sms_err("Could not allocate buffer for "
"init device message."); "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("invalid mode specified %d", mode); sms_err("invalid mode specified %d", mode);
return -EINVAL; return -EINVAL;
} }
@ -852,7 +851,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
} }
if (rc != 0) if (rc != 0)
sms_info("return error code %d.", rc); sms_err("return error code %d.", rc);
return rc; return rc;
} }
@ -1211,12 +1210,12 @@ 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("invalid vm flags"); sms_err("invalid vm flags");
return -EINVAL; return -EINVAL;
} }
if ((end - start) != size) { if ((end - start) != size) {
sms_info("invalid size %d expected %d", sms_err("invalid size %d expected %d",
(int)(end - start), (int) size); (int)(end - start), (int) size);
return -EINVAL; return -EINVAL;
} }
@ -1224,7 +1223,7 @@ int smscore_map_common_buffer(struct smscore_device_t *coredev,
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("remap_page_range failed"); sms_err("remap_page_range failed");
return -EAGAIN; return -EAGAIN;
} }

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

@ -329,7 +329,7 @@ int smsdvb_hotplug(struct smscore_device_t *coredev,
client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL);
if (!client) { if (!client) {
sms_info("kmalloc() failed"); sms_err("kmalloc() failed");
return -ENOMEM; return -ENOMEM;
} }
@ -385,7 +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("smscore_register_client() failed %d", rc); sms_err("smscore_register_client() failed %d", rc);
goto client_error; goto client_error;
} }

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

@ -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("error, urb status %d, %d bytes", sms_err("error, urb status %d, %d bytes",
urb->status, urb->actual_length); urb->status, urb->actual_length);
return; return;
} }
@ -81,12 +81,12 @@ 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("invalid response " sms_err("invalid response "
"msglen %d offset %d " "msglen %d offset %d "
"size %d", "size %d",
phdr->msgLength, phdr->msgLength,
surb->cb->offset, surb->cb->offset,
urb->actual_length); urb->actual_length);
goto exit_and_resubmit; goto exit_and_resubmit;
} }
@ -100,9 +100,9 @@ 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("invalid response " sms_err("invalid response "
"msglen %d actual %d", "msglen %d actual %d",
phdr->msgLength, urb->actual_length); phdr->msgLength, urb->actual_length);
} }
} }
@ -115,8 +115,7 @@ 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("smscore_getbuffer(...) " sms_err("smscore_getbuffer(...) returned NULL");
"returned NULL");
return -ENOMEM; return -ENOMEM;
} }
} }
@ -157,8 +156,7 @@ 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("smsusb_submit_urb(...) " sms_err("smsusb_submit_urb(...) failed");
"failed");
smsusb_stop_streaming(dev); smsusb_stop_streaming(dev);
break; break;
} }
@ -191,14 +189,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("invalid firmware id specified %d", id); sms_err("invalid firmware id specified %d", 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("failed to open \"%s\" mode %d", sms_err("failed to open \"%s\" mode %d",
smsusb1_fw_lkup[id], id); smsusb1_fw_lkup[id], id);
return rc; return rc;
} }
@ -213,7 +211,7 @@ int smsusb1_load_firmware(struct usb_device *udev, int id)
kfree(fw_buffer); kfree(fw_buffer);
} else { } else {
sms_info("failed to allocate firmware buffer"); sms_err("failed to allocate firmware buffer");
rc = -ENOMEM; rc = -ENOMEM;
} }
@ -250,7 +248,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("invalid firmware id specified %d", mode); sms_err("invalid firmware id specified %d", mode);
return -EINVAL; return -EINVAL;
} }
@ -287,8 +285,7 @@ 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("kzalloc(sizeof(struct smsusb_device_t) " sms_err("kzalloc(sizeof(struct smsusb_device_t) failed");
"failed");
return -ENOMEM; return -ENOMEM;
} }
@ -346,8 +343,7 @@ 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("smscore_register_device(...) failed, " sms_err("smscore_register_device(...) failed, rc %d", rc);
"rc %d", rc);
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
@ -363,14 +359,14 @@ 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_info("smsusb_start_streaming(...) failed"); sms_err("smsusb_start_streaming(...) failed");
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("smscore_start_device(...) failed"); sms_err("smscore_start_device(...) failed");
smsusb_term_device(intf); smsusb_term_device(intf);
return rc; return rc;
} }
@ -393,8 +389,7 @@ 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("usb_set_interface failed, " sms_err("usb_set_interface failed, rc %d", rc);
"rc %d", rc);
return rc; return rc;
} }
} }
@ -409,7 +404,7 @@ int smsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
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"); sms_err("rom interface 0 is not used");
return -ENODEV; return -ENODEV;
} }
@ -442,7 +437,7 @@ 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", rc); sms_err("usb_register failed. Error number %d", rc);
sms_debug(""); sms_debug("");