Skip to content

Commit 83cccdf

Browse files
gmarullnashif
authored andcommitted
drivers: display: st7789v: fix function argument
The st7789v_transmit function accepts a device, not device data. As a result, driver could not be compiled when reset GPIOs were not defined in Devicetree. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 0cb5e21 commit 83cccdf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/display/display_st7789v.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ static void st7789v_exit_sleep(const struct device *dev)
104104

105105
static void st7789v_reset_display(const struct device *dev)
106106
{
107-
struct st7789v_data *data = dev->data;
108-
109107
LOG_DBG("Resetting display");
110108
#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
109+
struct st7789v_data *data = dev->data;
110+
111111
k_sleep(K_MSEC(1));
112112
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 1);
113113
k_sleep(K_MSEC(6));
114114
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 0);
115115
k_sleep(K_MSEC(20));
116116
#else
117-
st7789v_transmit(data, ST7789V_CMD_SW_RESET, NULL, 0);
117+
st7789v_transmit(dev, ST7789V_CMD_SW_RESET, NULL, 0);
118118
k_sleep(K_MSEC(5));
119119
#endif
120120
}

0 commit comments

Comments
 (0)