]> git.baikalelectronics.ru Git - kernel.git/commit
counter: 104-quad-8: Return error when invalid mode during ceiling_write
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Tue, 3 Aug 2021 12:06:11 +0000 (21:06 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 07:47:34 +0000 (09:47 +0200)
commit74830048c7b8af6d5cc8418ba10cdf5124dbf201
treed88e4ffcbd142a82ea31f692c31811da104d45d5
parentfd87ff2fb34217eac5a199f202b7d43e382b0e3f
counter: 104-quad-8: Return error when invalid mode during ceiling_write

[ Upstream commit 728246e8f7269ecd35a2c6e6795323e6d8f48db7 ]

The 104-QUAD-8 only has two count modes where a ceiling value makes
sense: Range Limit and Modulo-N. Outside of these two modes, setting a
ceiling value is an invalid operation -- so let's report it as such by
returning -EINVAL.

Fixes: fc069262261c ("counter: 104-quad-8: Add lock guards - generic interface")
Acked-by: Syed Nayyar Waris <syednwaris@gmail.com>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Link: https://lore.kernel.org/r/a2147f022829b66839a1db5530a7fada47856847.1627990337.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/counter/104-quad-8.c