Commit 056254fa authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: dt9812: use dev->class_dev for all dev_{level} messages

For consistency in the driver, use dev->class_dev for the device in
all the dev_{level} messages.
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 4a76abeb
...@@ -681,7 +681,7 @@ static int dt9812_find_endpoints(struct comedi_device *dev) ...@@ -681,7 +681,7 @@ static int dt9812_find_endpoints(struct comedi_device *dev)
int i; int i;
if (host->desc.bNumEndpoints != 5) { if (host->desc.bNumEndpoints != 5) {
dev_err(&intf->dev, "Wrong number of endpoints\n"); dev_err(dev->class_dev, "Wrong number of endpoints\n");
return -ENODEV; return -ENODEV;
} }
...@@ -713,7 +713,8 @@ static int dt9812_find_endpoints(struct comedi_device *dev) ...@@ -713,7 +713,8 @@ static int dt9812_find_endpoints(struct comedi_device *dev)
break; break;
} }
if ((ep->bEndpointAddress & USB_DIR_IN) != dir) { if ((ep->bEndpointAddress & USB_DIR_IN) != dir) {
dev_err(&intf->dev, "Endpoint has wrong direction\n"); dev_err(dev->class_dev,
"Endpoint has wrong direction\n");
return -ENODEV; return -ENODEV;
} }
} }
...@@ -746,41 +747,42 @@ static int dt9812_reset_device(struct comedi_device *dev) ...@@ -746,41 +747,42 @@ static int dt9812_reset_device(struct comedi_device *dev)
break; break;
} }
if (ret) { if (ret) {
dev_err(&intf->dev, "unable to reset configuration\n"); dev_err(dev->class_dev,
"unable to reset configuration\n");
return ret; return ret;
} }
} }
ret = dt9812_read_info(dev, 1, &vendor, sizeof(vendor)); ret = dt9812_read_info(dev, 1, &vendor, sizeof(vendor));
if (ret) { if (ret) {
dev_err(&intf->dev, "failed to read vendor id\n"); dev_err(dev->class_dev, "failed to read vendor id\n");
return ret; return ret;
} }
vendor = le16_to_cpu(vendor); vendor = le16_to_cpu(vendor);
ret = dt9812_read_info(dev, 3, &product, sizeof(product)); ret = dt9812_read_info(dev, 3, &product, sizeof(product));
if (ret) { if (ret) {
dev_err(&intf->dev, "failed to read product id\n"); dev_err(dev->class_dev, "failed to read product id\n");
return ret; return ret;
} }
product = le16_to_cpu(product); product = le16_to_cpu(product);
ret = dt9812_read_info(dev, 5, &tmp16, sizeof(tmp16)); ret = dt9812_read_info(dev, 5, &tmp16, sizeof(tmp16));
if (ret) { if (ret) {
dev_err(&intf->dev, "failed to read device id\n"); dev_err(dev->class_dev, "failed to read device id\n");
return ret; return ret;
} }
devpriv->device = le16_to_cpu(tmp16); devpriv->device = le16_to_cpu(tmp16);
ret = dt9812_read_info(dev, 7, &serial, sizeof(serial)); ret = dt9812_read_info(dev, 7, &serial, sizeof(serial));
if (ret) { if (ret) {
dev_err(&intf->dev, "failed to read serial number\n"); dev_err(dev->class_dev, "failed to read serial number\n");
return ret; return ret;
} }
serial = le32_to_cpu(serial); serial = le32_to_cpu(serial);
/* let the user know what node this device is now attached to */ /* let the user know what node this device is now attached to */
dev_info(&intf->dev, "USB DT9812 (%4.4x.%4.4x.%4.4x) #0x%8.8x\n", dev_info(dev->class_dev, "USB DT9812 (%4.4x.%4.4x.%4.4x) #0x%8.8x\n",
vendor, product, devpriv->device, serial); vendor, product, devpriv->device, serial);
return 0; return 0;
......
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