staging: comedi: adv_pci1760: Do not return EINVAL for CMDF_ROUND_DOWN.
authorPhil Turnbull <phil.turnbull@oracle.com>
Fri, 29 Jul 2016 13:43:56 +0000 (09:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2016 15:07:19 +0000 (17:07 +0200)
The CMDF_ROUND_DOWN case falls through and so always returns -EINVAL.

Fixes: 14b93bb6bbf0 ("staging: comedi: adv_pci_dio: separate out PCI-1760 support")
Signed-off-by: Phil Turnbull <phil.turnbull@oracle.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/adv_pci1760.c

index d7dd1e55e347be5f3037d33ba81e343c18e13521..9f525ff7290c69b764503a232fcd9d7a7de338b3 100644 (file)
@@ -196,6 +196,7 @@ static int pci1760_pwm_ns_to_div(unsigned int flags, unsigned int ns)
                break;
        case CMDF_ROUND_DOWN:
                divisor = ns / PCI1760_PWM_TIMEBASE;
+               break;
        default:
                return -EINVAL;
        }