Commit 2a8cdc68 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbduxsigma: tidy up firmware upload error messages

Use dev->class_dev for all dev_{level} messages.

Remove the unnecessary error message for a kmemdup() failure.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a59a28a3
...@@ -502,7 +502,6 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev, ...@@ -502,7 +502,6 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev,
unsigned long context) unsigned long context)
{ {
struct usb_device *usb = comedi_to_usb_dev(dev); struct usb_device *usb = comedi_to_usb_dev(dev);
struct usbduxsigma_private *usbduxsub = dev->private;
uint8_t *buf; uint8_t *buf;
uint8_t *tmp; uint8_t *tmp;
int ret; int ret;
...@@ -511,18 +510,14 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev, ...@@ -511,18 +510,14 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev,
return 0; return 0;
if (size > FIRMWARE_MAX_LEN) { if (size > FIRMWARE_MAX_LEN) {
dev_err(&usbduxsub->interface->dev, dev_err(dev->class_dev, "firmware binary too large for FX2\n");
"usbduxsigma firmware binary it too large for FX2.\n");
return -ENOMEM; return -ENOMEM;
} }
/* we generate a local buffer for the firmware */ /* we generate a local buffer for the firmware */
buf = kmemdup(data, size, GFP_KERNEL); buf = kmemdup(data, size, GFP_KERNEL);
if (!buf) { if (!buf)
dev_err(&usbduxsub->interface->dev,
"comedi_: mem alloc for firmware failed\n");
return -ENOMEM; return -ENOMEM;
}
/* we need a malloc'ed buffer for usb_control_msg() */ /* we need a malloc'ed buffer for usb_control_msg() */
tmp = kmalloc(1, GFP_KERNEL); tmp = kmalloc(1, GFP_KERNEL);
...@@ -540,8 +535,7 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev, ...@@ -540,8 +535,7 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev,
tmp, 1, tmp, 1,
BULK_TIMEOUT); BULK_TIMEOUT);
if (ret < 0) { if (ret < 0) {
dev_err(&usbduxsub->interface->dev, dev_err(dev->class_dev, "can not stop firmware\n");
"comedi_: can not stop firmware\n");
goto done; goto done;
} }
...@@ -553,8 +547,7 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev, ...@@ -553,8 +547,7 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev,
buf, size, buf, size,
BULK_TIMEOUT); BULK_TIMEOUT);
if (ret < 0) { if (ret < 0) {
dev_err(&usbduxsub->interface->dev, dev_err(dev->class_dev, "firmware upload failed\n");
"comedi_: firmware upload failed\n");
goto done; goto done;
} }
...@@ -567,8 +560,7 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev, ...@@ -567,8 +560,7 @@ static int usbduxsigma_firmware_upload(struct comedi_device *dev,
tmp, 1, tmp, 1,
BULK_TIMEOUT); BULK_TIMEOUT);
if (ret < 0) if (ret < 0)
dev_err(&usbduxsub->interface->dev, dev_err(dev->class_dev, "can not start firmware\n");
"comedi_: can not start firmware\n");
done: done:
kfree(tmp); kfree(tmp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment