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:50:38 +0000 (09:50 +0200)
commit974ab0a04fe6d2757a4a0b027deca28f263f51bb
treedbfb9ca9cf0bbd80d9b7f978ca127f0333b6c76c
parentc158f9b232796a94dc55c4b0fa0147d30312b96c
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