From 5ce7845f71edce5f5d56fc9e2fb74ea79e9a5b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Sp=C3=A4tling?= Date: Wed, 21 Aug 2024 14:09:44 +0200 Subject: [PATCH] mipi_dbi: stm32: use proper type for timeout argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reset function uses uint32_t as its 2nd parameter, which leads to the following compiler warning. zephyr/drivers/mipi_dbi/mipi_dbi_stm32_fmc.c:176:18: warning: initialization of 'int (*)(const struct device *, k_timeout_t)' from incompatible pointer type 'int (*)(const struct device *, uint32_t)' {aka 'int (*)(const struct device *, unsigned int)'} [-Wincompatible-pointer-types] 176 | .reset = mipi_dbi_stm32_fmc_reset, | ^~~~~~~~~~~~~~~~~~~~~~~~ When you look at similar drivers, /drivers/mipi_dbi/mipi_dbi_smartbond.c#L126 /drivers/mipi_dbi/mipi_dbi_nxp_lcdic.c#L561 you notice they use k_timeout_t. So the whole fix is to correct the type. Signed-off-by: Thorsten Spätling --- drivers/mipi_dbi/mipi_dbi_stm32_fmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mipi_dbi/mipi_dbi_stm32_fmc.c b/drivers/mipi_dbi/mipi_dbi_stm32_fmc.c index f71c36f1a18..19c34ea5010 100644 --- a/drivers/mipi_dbi/mipi_dbi_stm32_fmc.c +++ b/drivers/mipi_dbi/mipi_dbi_stm32_fmc.c @@ -122,7 +122,7 @@ static int mipi_dbi_stm32_fmc_write_display(const struct device *dev, return 0; } -static int mipi_dbi_stm32_fmc_reset(const struct device *dev, uint32_t delay) +static int mipi_dbi_stm32_fmc_reset(const struct device *dev, k_timeout_t delay) { const struct mipi_dbi_stm32_fmc_config *config = dev->config; int ret; @@ -136,7 +136,7 @@ static int mipi_dbi_stm32_fmc_reset(const struct device *dev, uint32_t delay) return ret; } - k_msleep(delay); + k_sleep(delay); return gpio_pin_set_dt(&config->reset, 0); }