Skip to content

Commit

Permalink
drm/panel: ili9341: Use predefined error codes
Browse files Browse the repository at this point in the history
[ Upstream commit da85f0a ]

In one case the -1 is returned which is quite confusing code for
the wrong device ID, in another the ret is returning instead of
plain 0 that also confusing as readed may ask the possible meaning
of positive codes, which are never the case there. Convert both
to use explicit predefined error codes to make it clear what's going
on there.

Fixes: 5a04227 ("drm/panel: Add ilitek ili9341 panel driver")
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Reviewed-by: Sui Jingfeng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
andy-shev authored and gregkh committed May 17, 2024
1 parent dfa58fc commit 962fbe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/panel/panel-ilitek-ili9341.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static int ili9341_dpi_prepare(struct drm_panel *panel)

ili9341_dpi_init(ili);

return ret;
return 0;
}

static int ili9341_dpi_enable(struct drm_panel *panel)
Expand Down Expand Up @@ -726,7 +726,7 @@ static int ili9341_probe(struct spi_device *spi)
else if (!strcmp(id->name, "yx240qv29"))
return ili9341_dbi_probe(spi, dc, reset);

return -1;
return -ENODEV;
}

static void ili9341_remove(struct spi_device *spi)
Expand Down

0 comments on commit 962fbe7

Please sign in to comment.