The check after flashing is inverted: memcmp() returns 0 when the read
back matches the image, so a good update is reported as "Firmware
update failed", with a hex dump and -EINVAL to the sysfs writer (and a
failed probe-time update for a blank chip), while a mismatch is
reported as success.
Treat a mismatch as the failure.
Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge")
Signed-off-by: Dmitry Baryshkov <[email protected]>
---
drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index 6a7d479e86f6..8992222c6a5a 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -691,7 +691,7 @@ static int lt9611uxc_firmware_update(struct lt9611uxc
*lt9611uxc)
goto out;
}
- if (!memcmp(readbuf, fw->data, fw->size)) {
+ if (memcmp(readbuf, fw->data, fw->size)) {
dev_err(lt9611uxc->dev, "Firmware update failed\n");
print_hex_dump(KERN_ERR, "fw: ", DUMP_PREFIX_OFFSET, 16, 1,
readbuf, fw->size, false);
ret = -EINVAL;
--
2.47.3