mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
drm/panel: novatek-nt35560: Fix invalid return value
[ Upstream commit125459e19e] Fix bug in nt35560_set_brightness() which causes the function to erroneously report an error. mipi_dsi_dcs_write() returns either a negative value when an error occurred or a positive number of bytes written when no error occurred. The buggy code reports an error under either condition. Fixes:8152c2bfd7("drm/panel: Add driver for Sony ACX424AKP panel") Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Brigham Campbell <me@brighamcampbell.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250731032343.1258366-2-me@brighamcampbell.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
87d0402cad
commit
738b014c94
@@ -161,7 +161,7 @@ static int nt35560_set_brightness(struct backlight_device *bl)
|
|||||||
par = 0x00;
|
par = 0x00;
|
||||||
ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
|
ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
|
||||||
&par, 1);
|
&par, 1);
|
||||||
if (ret) {
|
if (ret < 0) {
|
||||||
dev_err(nt->dev, "failed to disable display backlight (%d)\n", ret);
|
dev_err(nt->dev, "failed to disable display backlight (%d)\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user