Skip to content

Commit b11fcc8

Browse files
GeorgeCGVcarlescufi
authored andcommitted
drivers: display: stm32_ltdc: fix set orientation API
Refactors invalid switch into if statement. Fixes orientation set return value for normal display orientation. Signed-off-by: Georgij Cernysiov <[email protected]>
1 parent f3204b7 commit b11fcc8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/display/display_stm32_ltdc.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,13 @@ static int stm32_ltdc_set_pixel_format(const struct device *dev,
129129
static int stm32_ltdc_set_orientation(const struct device *dev,
130130
const enum display_orientation orientation)
131131
{
132-
int err;
132+
ARG_UNUSED(dev);
133133

134-
switch (orientation) {
135-
case DISPLAY_ORIENTATION_NORMAL:
136-
err = 0;
137-
default:
138-
err = -ENOTSUP;
134+
if (orientation == DISPLAY_ORIENTATION_NORMAL) {
135+
return 0;
139136
}
140137

141-
return err;
138+
return -ENOTSUP;
142139
}
143140

144141
static void stm32_ltdc_get_capabilities(const struct device *dev,

0 commit comments

Comments
 (0)