From 6f39b083439072cb451faaaf89483bbd7d592f90 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 4 Apr 2022 16:56:04 +0200 Subject: [PATCH] drivers: pwm: gecko: fix access to timer register The timer registers are accessible via the device config field, driver code was wrong in one case (pwm is the variable indicating PWM channel). Signed-off-by: Gerard Marull-Paretas --- drivers/pwm/pwm_gecko.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm_gecko.c b/drivers/pwm/pwm_gecko.c index a4362b7ff40..3512228d513 100644 --- a/drivers/pwm/pwm_gecko.c +++ b/drivers/pwm/pwm_gecko.c @@ -37,7 +37,7 @@ static int pwm_gecko_pin_set(const struct device *dev, uint32_t pwm, BUS_RegMaskedWrite(&cfg->timer->ROUTE, _TIMER_ROUTE_LOCATION_MASK, cfg->location << _TIMER_ROUTE_LOCATION_SHIFT); - BUS_RegMaskedSet(&pwm->timer->ROUTE, 1 << pwm); + BUS_RegMaskedSet(&cfg->timer->ROUTE, 1 << pwm); #elif defined(_TIMER_ROUTELOC0_MASK) BUS_RegMaskedWrite(&cfg->timer->ROUTELOC0, _TIMER_ROUTELOC0_CC0LOC_MASK << (pwm * _TIMER_ROUTELOC0_CC1LOC_SHIFT),