]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
staging: comedi: dt9812: pass the comedi_device * to dt9812_configure_mux()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 May 2013 21:26:05 +0000 (14:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2013 23:25:57 +0000 (16:25 -0700)
For aesthetic reasons, instead of passing the struct usb_dt9812 pointer,
pass the comedi_device pointer to this function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/dt9812.c

index 7fb90a7c0234a34d2c8d1c3841dc538e2002669a..965e96ddb8d15531ae2710ee518ae937fef1a7ad 100644 (file)
@@ -446,10 +446,14 @@ static int dt9812_digital_out_shadow(struct comedi_device *dev, u8 *bits)
        return ret;
 }
 
-static void dt9812_configure_mux(struct usb_dt9812 *dev,
+static void dt9812_configure_mux(struct comedi_device *dev,
                                 struct dt9812_rmw_byte *rmw, int channel)
 {
-       if (dev->device == DT9812_DEVID_DT9812_10) {
+       struct dt9812_private *devpriv = dev->private;
+       struct slot_dt9812 *slot = devpriv->slot;
+       struct usb_dt9812 *usb = slot->usb;
+
+       if (usb->device == DT9812_DEVID_DT9812_10) {
                /* In the DT9812/10V MUX is selected by P1.5-7 */
                rmw->address = F020_SFR_P1;
                rmw->and_mask = 0xe0;
@@ -536,7 +540,7 @@ static int dt9812_analog_in(struct comedi_device *dev,
        dt9812_configure_gain(dev, &rmw[0], gain);
 
        /* 2 set the MUX to select the channel */
-       dt9812_configure_mux(slot->usb, &rmw[1], channel);
+       dt9812_configure_mux(dev, &rmw[1], channel);
 
        /* 3 start conversion */
        rmw[2].address = F020_SFR_ADC0CN;