Commit 748367d1 authored by Pisit Sawangvonganan's avatar Pisit Sawangvonganan Committed by Anas Nashif
Browse files

drivers: gpio: stm32: clean up unnecessary code

Removed the unnecessary initialization of the `ret` variable in
`gpio_stm32_clock_request` where its value is guaranteed to be
overwritten by subsequent operations, then simply returned `ret`.

Signed-off-by: default avatarPisit Sawangvonganan <pisit@ndrsolution.com>
parent 944305dc
Loading
Loading
Loading
Loading
+1 −5
Changes for drivers/gpio/gpio_stm32.c: 1 added line, 5 removed lines.
Original line number Diff line number Diff line
@@ -276,7 +276,7 @@ static void gpio_stm32_configure_raw(const struct device *dev, int pin,
static int gpio_stm32_clock_request(const struct device *dev, bool on)
{
	const struct gpio_stm32_config *cfg = dev->config;
	int ret = 0;
	int ret;

	__ASSERT_NO_MSG(dev != NULL);

@@ -291,10 +291,6 @@ static int gpio_stm32_clock_request(const struct device *dev, bool on)
					(clock_control_subsys_t)&cfg->pclken);
	}

	if (ret != 0) {
		return ret;
	}

	return ret;
}