From b40c052289ee46406e73a08974d903d9f10b0693 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Wed, 9 Aug 2023 12:20:36 +0200 Subject: [PATCH] samples drivers led: Fix main return Since 3a197934fca250e456e6fe84ca02309a8b437086 main() should be int main(void) instead of void main(void) Signed-off-by: Alberto Escolar Piedras --- samples/drivers/led_is31fl3733/src/main.c | 14 +++++++------- samples/drivers/led_lp50xx/src/main.c | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/samples/drivers/led_is31fl3733/src/main.c b/samples/drivers/led_is31fl3733/src/main.c index c878d998b6..f80e03298c 100644 --- a/samples/drivers/led_is31fl3733/src/main.c +++ b/samples/drivers/led_is31fl3733/src/main.c @@ -110,28 +110,28 @@ static int led_on_off(const struct device *led) const struct device *led_dev = DEVICE_DT_GET_ONE(issi_is31fl3733); -void main(void) +int main(void) { int ret; int current_limit = 0xFF; if (!device_is_ready(led_dev)) { printk("Error- LED device is not ready\n"); - return; + return 0; } while (1) { ret = led_channel_write(led_dev); if (ret < 0) { - return; + return 0; } ret = led_brightness(led_dev); if (ret < 0) { - return; + return 0; } ret = led_on_off(led_dev); if (ret < 0) { - return; + return 0; } if (current_limit == 0xFF) { /* Select lower current limt */ @@ -140,7 +140,7 @@ void main(void) ret = is31fl3733_current_limit(led_dev, current_limit); if (ret) { printk("Could not set LED current limit (%d)\n", ret); - return; + return 0; } } else { /* Select higher current limt */ @@ -149,7 +149,7 @@ void main(void) ret = is31fl3733_current_limit(led_dev, current_limit); if (ret) { printk("Could not set LED current limit (%d)\n", ret); - return; + return 0; } } } diff --git a/samples/drivers/led_lp50xx/src/main.c b/samples/drivers/led_lp50xx/src/main.c index b10812a1da..be6a801fbc 100644 --- a/samples/drivers/led_lp50xx/src/main.c +++ b/samples/drivers/led_lp50xx/src/main.c @@ -330,7 +330,7 @@ static int run_test(const struct device *const lp50xx_dev, return 0; } -void main(void) +int main(void) { const struct device *lp50xx_dev; bool found = false; @@ -434,4 +434,5 @@ void main(void) if (!found) { LOG_ERR("No LP50XX LED controller found"); } + return 0; }