Merge tag 'kgdb-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt...
[linux-2.6-microblaze.git] / drivers / counter / stm32-lptimer-cnt.c
index c19d998..1365695 100644 (file)
@@ -134,9 +134,9 @@ enum stm32_lptim_cnt_function {
        STM32_LPTIM_ENCODER_BOTH_EDGE,
 };
 
-static const enum counter_count_function stm32_lptim_cnt_functions[] = {
-       [STM32_LPTIM_COUNTER_INCREASE] = COUNTER_COUNT_FUNCTION_INCREASE,
-       [STM32_LPTIM_ENCODER_BOTH_EDGE] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4,
+static const enum counter_function stm32_lptim_cnt_functions[] = {
+       [STM32_LPTIM_COUNTER_INCREASE] = COUNTER_FUNCTION_INCREASE,
+       [STM32_LPTIM_ENCODER_BOTH_EDGE] = COUNTER_FUNCTION_QUADRATURE_X4,
 };
 
 enum stm32_lptim_synapse_action {
@@ -206,9 +206,10 @@ static int stm32_lptim_cnt_function_set(struct counter_device *counter,
                priv->quadrature_mode = 1;
                priv->polarity = STM32_LPTIM_SYNAPSE_ACTION_BOTH_EDGES;
                return 0;
+       default:
+               /* should never reach this path */
+               return -EINVAL;
        }
-
-       return -EINVAL;
 }
 
 static ssize_t stm32_lptim_cnt_enable_read(struct counter_device *counter,
@@ -282,7 +283,7 @@ static ssize_t stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
                return ret;
 
        if (ceiling > STM32_LPTIM_MAX_ARR)
-               return -EINVAL;
+               return -ERANGE;
 
        priv->ceiling = ceiling;
 
@@ -326,9 +327,10 @@ static int stm32_lptim_cnt_action_get(struct counter_device *counter,
        case STM32_LPTIM_ENCODER_BOTH_EDGE:
                *action = priv->polarity;
                return 0;
+       default:
+               /* should never reach this path */
+               return -EINVAL;
        }
-
-       return -EINVAL;
 }
 
 static int stm32_lptim_cnt_action_set(struct counter_device *counter,