drm/bridge: nxp-ptn3460: simplify some error checking
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 6 Dec 2023 15:05:15 +0000 (18:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:08 +0000 (16:19 -0800)
commit7510670bb46a586b65ef7c3b38f5297ebc5b871b
treeefb2243eef7a97310de5f5f9abf76baae52b3539
parent6266b3a312b7f69c883c2d7c82d85772464421d2
drm/bridge: nxp-ptn3460: simplify some error checking

commit 28d3d0696688154cc04983f343011d07bf0508e4 upstream.

The i2c_master_send/recv() functions return negative error codes or
they return "len" on success.  So the error handling here can be written
as just normal checks for "if (ret < 0) return ret;".  No need to
complicate things.

Btw, in this code the "len" parameter can never be zero, but even if
it were, then I feel like this would still be the best way to write it.

Fixes: 914437992876 ("drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking")
Suggested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/04242630-42d8-4920-8c67-24ac9db6b3c9@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/bridge/nxp-ptn3460.c