diff options
author | William Breathitt Gray <vilhelm.gray@gmail.com> | 2021-08-03 14:06:13 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-08-09 21:17:36 +0200 |
commit | e2ff3198c580a3a3acfdc50cce5b5f8a941cbcd1 (patch) | |
tree | c362f49faac490020b6d8225340a7bb48e301ec3 /drivers/counter/104-quad-8.c | |
parent | counter: Return error code on invalid modes (diff) | |
download | linux-e2ff3198c580a3a3acfdc50cce5b5f8a941cbcd1.tar.xz linux-e2ff3198c580a3a3acfdc50cce5b5f8a941cbcd1.zip |
counter: Standardize to ERANGE for limit exceeded errors
ERANGE is a semantically better error code to return when an argument
value falls outside the supported limit range of a device.
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Acked-by: Syed Nayyar Waris <syednwaris@gmail.com>
Reviewed-by: David Lechner <david@lechnology.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Link: https://lore.kernel.org/r/ae8d3b20b8b02c96b1c9898ffa2f9fa5d99edc81.1627990337.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/counter/104-quad-8.c')
-rw-r--r-- | drivers/counter/104-quad-8.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c index b358b2b2b883..d54efdb8d393 100644 --- a/drivers/counter/104-quad-8.c +++ b/drivers/counter/104-quad-8.c @@ -154,7 +154,7 @@ static int quad8_count_write(struct counter_device *counter, /* Only 24-bit values are supported */ if (val > 0xFFFFFF) - return -EINVAL; + return -ERANGE; mutex_lock(&priv->lock); @@ -669,7 +669,7 @@ static ssize_t quad8_count_preset_write(struct counter_device *counter, /* Only 24-bit values are supported */ if (preset > 0xFFFFFF) - return -EINVAL; + return -ERANGE; mutex_lock(&priv->lock); @@ -714,7 +714,7 @@ static ssize_t quad8_count_ceiling_write(struct counter_device *counter, /* Only 24-bit values are supported */ if (ceiling > 0xFFFFFF) - return -EINVAL; + return -ERANGE; mutex_lock(&priv->lock); |