iio: dac: mcp4922: fix error handling in mcp4922_write_raw
authorMarcus Folkesson <marcus.folkesson@gmail.com>
Fri, 24 Aug 2018 20:24:40 +0000 (22:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:51:59 +0000 (09:51 +0100)
commitb7f8108a1cd47a12fd1f9d432d69ad4f049d0582
treee4250bab056fd0e7635641646e31d1132764ff92
parent35940da897ed4760608b7fb01850a9923fd0965f
iio: dac: mcp4922: fix error handling in mcp4922_write_raw

[ Upstream commit 0833627fc3f757a0dca11e2a9c46c96335a900ee ]

Do not try to write negative values and make sure that the write goes well.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/dac/mcp4922.c