From: Patrick Delaunay Date: Fri, 21 Jun 2019 13:26:41 +0000 (+0200) Subject: serial: stm32: Fix warnings when compiling with W=1 X-Git-Tag: v2019.10-rc1~30^2~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=585289b4fc47a8d745bf922b86f4adc69b24088e;p=oweals%2Fu-boot.git serial: stm32: Fix warnings when compiling with W=1 This patch solves the following warnings: drivers/serial/serial_stm32.c: In function 'stm32_serial_probe': warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (plat->clock_rate < 0) { ^ Signed-off-by: Patrice Chotard Signed-off-by: Patrick Delaunay --- diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c index cca8b707ac..3ab536a52a 100644 --- a/drivers/serial/serial_stm32.c +++ b/drivers/serial/serial_stm32.c @@ -195,9 +195,9 @@ static int stm32_serial_probe(struct udevice *dev) } plat->clock_rate = clk_get_rate(&clk); - if (plat->clock_rate < 0) { + if (!plat->clock_rate) { clk_disable(&clk); - return plat->clock_rate; + return -EINVAL; }; _stm32_serial_init(plat->base, plat->uart_info);