Commit 0e631b2b authored by Gustavo Silva's avatar Gustavo Silva Committed by Josh Lilly
Browse files

drivers: pwm: pwm_mcux: fix for coverity 321142

Fix `PWM_SetupPwm` function being called with `numOfChnls`
argument equal to 2, when in fact only one channel is being set up.

Also add 'U' suffix to `pwmFreq_Hz` unsigned integer argument in
the function call.

Signed-off-by: default avatarGustavo Silva <gustavograzs@gmail.com>
(cherry picked from commit 4eedd45c)
parent 339194de
Loading
Loading
Loading
Loading
+2 −2
Changes for drivers/pwm/pwm_mcux.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -96,8 +96,8 @@ static int mcux_pwm_set_cycles(const struct device *dev, uint32_t channel,
		data->channel[channel].level = level;

		status = PWM_SetupPwm(config->base, config->index,
				      &data->channel[channel], CHANNEL_COUNT,
				      config->mode, 1, clock_freq);
				      &data->channel[channel], 1U,
				      config->mode, 1U, clock_freq);
		if (status != kStatus_Success) {
			LOG_ERR("Could not set up pwm");
			return -ENOTSUP;