Merge tag 'dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / drivers / counter / interrupt-cnt.c
index 5df7cd1..1de4243 100644 (file)
@@ -107,13 +107,16 @@ static int interrupt_cnt_write(struct counter_device *counter,
 {
        struct interrupt_cnt_priv *priv = counter->priv;
 
+       if (val != (typeof(priv->count.counter))val)
+               return -ERANGE;
+
        atomic_set(&priv->count, val);
 
        return 0;
 }
 
-static const enum counter_count_function interrupt_cnt_functions[] = {
-       COUNTER_COUNT_FUNCTION_INCREASE,
+static const enum counter_function interrupt_cnt_functions[] = {
+       COUNTER_FUNCTION_INCREASE,
 };
 
 static int interrupt_cnt_function_get(struct counter_device *counter,
@@ -127,7 +130,7 @@ static int interrupt_cnt_function_get(struct counter_device *counter,
 
 static int interrupt_cnt_signal_read(struct counter_device *counter,
                                     struct counter_signal *signal,
-                                    enum counter_signal_value *val)
+                                    enum counter_signal_level *level)
 {
        struct interrupt_cnt_priv *priv = counter->priv;
        int ret;
@@ -139,7 +142,7 @@ static int interrupt_cnt_signal_read(struct counter_device *counter,
        if (ret < 0)
                return ret;
 
-       *val = ret ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW;
+       *level = ret ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW;
 
        return 0;
 }