[PATCH 06/15] staging: comedi: dt9812: use comedi_to_usb_dev()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the helper function to get a usb_device pointer from a
comedi_device pointer. This removes the need for also getting
the usb_interface pointer in some cases.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/dt9812.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c
index 9aab5b9..6c60949 100644
--- a/drivers/staging/comedi/drivers/dt9812.c
+++ b/drivers/staging/comedi/drivers/dt9812.c
@@ -252,8 +252,7 @@ struct dt9812_private {
 static int dt9812_read_info(struct comedi_device *dev,
 			    int offset, void *buf, size_t buf_size)
 {
-	struct usb_interface *intf = comedi_to_usb_interface(dev);
-	struct usb_device *usb = interface_to_usbdev(intf);
+	struct usb_device *usb = comedi_to_usb_dev(dev);
 	struct dt9812_private *devpriv = dev->private;
 	struct dt9812_usb_cmd cmd;
 	int count, ret;
@@ -277,8 +276,7 @@ static int dt9812_read_multiple_registers(struct comedi_device *dev,
 					  int reg_count, u8 *address,
 					  u8 *value)
 {
-	struct usb_interface *intf = comedi_to_usb_interface(dev);
-	struct usb_device *usb = interface_to_usbdev(intf);
+	struct usb_device *usb = comedi_to_usb_dev(dev);
 	struct dt9812_private *devpriv = dev->private;
 	struct dt9812_usb_cmd cmd;
 	int i, count, ret;
@@ -302,8 +300,7 @@ static int dt9812_write_multiple_registers(struct comedi_device *dev,
 					   int reg_count, u8 *address,
 					   u8 *value)
 {
-	struct usb_interface *intf = comedi_to_usb_interface(dev);
-	struct usb_device *usb = interface_to_usbdev(intf);
+	struct usb_device *usb = comedi_to_usb_dev(dev);
 	struct dt9812_private *devpriv = dev->private;
 	struct dt9812_usb_cmd cmd;
 	int i, count;
@@ -324,8 +321,7 @@ static int dt9812_rmw_multiple_registers(struct comedi_device *dev,
 					 int reg_count,
 					 struct dt9812_rmw_byte *rmw)
 {
-	struct usb_interface *intf = comedi_to_usb_interface(dev);
-	struct usb_device *usb = interface_to_usbdev(intf);
+	struct usb_device *usb = comedi_to_usb_dev(dev);
 	struct dt9812_private *devpriv = dev->private;
 	struct dt9812_usb_cmd cmd;
 	int i, count;
@@ -706,8 +702,7 @@ static int dt9812_find_endpoints(struct comedi_device *dev)
 
 static int dt9812_reset_device(struct comedi_device *dev)
 {
-	struct usb_interface *intf = comedi_to_usb_interface(dev);
-	struct usb_device *usb = interface_to_usbdev(intf);
+	struct usb_device *usb = comedi_to_usb_dev(dev);
 	struct dt9812_private *devpriv = dev->private;
 	u32 serial;
 	u16 vendor;
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux