]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: dt9812: default the analog input gain to 1
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 May 2013 21:35:47 +0000 (14:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2013 23:26:04 +0000 (16:26 -0700)
The 'default' case should never happen. In case it does, default the
gain to '1'.

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 9281d49dbdebf083a1a29fa7081e38ef614054d8..e6d9191f9432a56b052cc01de291ddca210a107e 100644 (file)
@@ -422,6 +422,8 @@ static void dt9812_configure_gain(struct comedi_device *dev,
                rmw->or_value = F020_MASK_ADC0CF_AMP0GN2 |
                                F020_MASK_ADC0CF_AMP0GN1;
                break;
+       default:
+               /* this should never happen, just use a gain of 1 */
        case DT9812_GAIN_1:
                rmw->or_value = 0x00;
                break;
@@ -438,9 +440,6 @@ static void dt9812_configure_gain(struct comedi_device *dev,
        case DT9812_GAIN_16:
                rmw->or_value = F020_MASK_ADC0CF_AMP0GN2;
                break;
-       default:
-               dev_err(dev->class_dev, "Illegal gain %d\n", gain);
-               break;
        }
 }