Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d25025c authored by Thierry Reding's avatar Thierry Reding
Browse files

pwm: fsl-ftm: Make sure to unlock mutex on failure



Upon failure to enable clocks while trying to enable the PWM, make sure
to unlock the mutex that was taken to avoid a deadlock during subsequent
operations.

Reported-by: default avatarkbuild test robot <lkp@intel.com>
Reported-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Cc: Patrick Havelange <patrick.havelange@essensium.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent a2a28229
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -342,12 +342,12 @@ static int fsl_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
	if (!oldstate->enabled) {
		ret = clk_prepare_enable(fpc->clk[fpc->period.clk_select]);
		if (ret)
			return ret;
			goto end_mutex;

		ret = clk_prepare_enable(fpc->clk[FSL_PWM_CLK_CNTEN]);
		if (ret) {
			clk_disable_unprepare(fpc->clk[fpc->period.clk_select]);
			return ret;
			goto end_mutex;
		}

		regmap_update_bits(fpc->regmap, FTM_OUTMASK, BIT(pwm->hwpwm),