Commit 421b42ab authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: dt9812: remove unused variables from private data

The vendor, product, and serial numbers read from the usb device
are only used for a dev_info() message about the device after it
is reset. Reading these values might not be required for the usb
device to function.

For now just remove the variables from the private data and just
use local variables.
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 b78750c1
...@@ -263,9 +263,6 @@ struct dt9812_private { ...@@ -263,9 +263,6 @@ struct dt9812_private {
__u8 addr; __u8 addr;
size_t size; size_t size;
} cmd_wr, cmd_rd; } cmd_wr, cmd_rd;
u32 serial;
u16 vendor;
u16 product;
u16 device; u16 device;
u16 ao_shadow[2]; u16 ao_shadow[2];
u8 do_shadow; u8 do_shadow;
...@@ -741,11 +738,13 @@ static int dt9812_reset_device(struct comedi_device *dev) ...@@ -741,11 +738,13 @@ static int dt9812_reset_device(struct comedi_device *dev)
struct usb_interface *intf = comedi_to_usb_interface(dev); struct usb_interface *intf = comedi_to_usb_interface(dev);
struct usb_device *usb = interface_to_usbdev(intf); struct usb_device *usb = interface_to_usbdev(intf);
struct dt9812_private *devpriv = dev->private; struct dt9812_private *devpriv = dev->private;
int ret; u32 serial;
int i; u16 vendor;
u32 tmp32; u16 product;
u16 tmp16; u16 tmp16;
u8 tmp8; u8 tmp8;
int ret;
int i;
ret = dt9812_read_info(dev, 0, &tmp8, sizeof(tmp8)); ret = dt9812_read_info(dev, 0, &tmp8, sizeof(tmp8));
if (ret) { if (ret) {
...@@ -765,19 +764,19 @@ static int dt9812_reset_device(struct comedi_device *dev) ...@@ -765,19 +764,19 @@ static int dt9812_reset_device(struct comedi_device *dev)
} }
} }
ret = dt9812_read_info(dev, 1, &tmp16, sizeof(tmp16)); 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(&intf->dev, "failed to read vendor id\n");
return ret; return ret;
} }
devpriv->vendor = le16_to_cpu(tmp16); vendor = le16_to_cpu(vendor);
ret = dt9812_read_info(dev, 3, &tmp16, sizeof(tmp16)); 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(&intf->dev, "failed to read product id\n");
return ret; return ret;
} }
devpriv->product = le16_to_cpu(tmp16); 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) {
...@@ -786,17 +785,16 @@ static int dt9812_reset_device(struct comedi_device *dev) ...@@ -786,17 +785,16 @@ static int dt9812_reset_device(struct comedi_device *dev)
} }
devpriv->device = le16_to_cpu(tmp16); devpriv->device = le16_to_cpu(tmp16);
ret = dt9812_read_info(dev, 7, &tmp32, sizeof(tmp32)); 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(&intf->dev, "failed to read serial number\n");
return ret; return ret;
} }
devpriv->serial = le32_to_cpu(tmp32); 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(&intf->dev, "USB DT9812 (%4.4x.%4.4x.%4.4x) #0x%8.8x\n",
devpriv->vendor, devpriv->product, devpriv->device, vendor, product, devpriv->device, serial);
devpriv->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