Input: iqs7222 - report malformed properties
authorJeff LaBundy <jeff@labundy.com>
Sun, 23 Oct 2022 00:56:38 +0000 (19:56 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:08 +0000 (13:33 +0100)
commitfa25c90ee9a7a942ff9d892e314c8f0b323cd67d
tree35102b4d43cc07e79ae991354f4ad55295ae9051
parent201d1baa9a455dbf133674e46bf0a99ca2dbe10d
Input: iqs7222 - report malformed properties

[ Upstream commit 404f3b48e65f058d94429e4a1ec16a1f82ff3b2f ]

Nonzero return values of several calls to fwnode_property_read_u32()
are silently ignored, leaving no way to know the properties were not
applied in the event of an error.

Solve this problem by evaluating fwnode_property_read_u32()'s return
value, and reporting an error for any nonzero return value not equal
to -EINVAL which indicates the property was absent altogether.

Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/Y1SRRrpQXvkETjfm@nixie71
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/misc/iqs7222.c