Skip to contentSkip to conversation

FAILED: patch "[PATCH] iio: trigger: stm32-timer: fix get trigger mode" failed to apply to 4.12-stable tree

PATCH [email protected] 1 participant 1 message Aug 28, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From a359bb2a55f384bb93349ddf9d30b20b37e02e8a Mon Sep 17 00:00:00 2001

From: Fabrice Gasnier <[email protected]>
Date: Thu, 3 Aug 2017 11:22:17 +0200
Subject: [PATCH] iio: trigger: stm32-timer: fix get trigger mode

Fix reading trigger mode, when other bit-fields are set. SMCR register value must be masked to read SMS (slave mode selection) only.

Fixes 9eba381 ("iio: make stm32 trigger driver use

INDIO_HARDWARE_TRIGGERED mode")

drivers/iio/trigger/stm32-timer-trigger.c +1 -1
index 14e6eb04bbb0..25ad6abfee22 100644
@@ -485,7 +485,7 @@ static int stm32_get_trigger_mode(struct iio_dev *indio_dev,
 
 	regmap_read(priv->regmap, TIM_SMCR, &smcr);
 
-	return smcr == TIM_SMCR_SMS ? 0 : -EINVAL;
+	return (smcr & TIM_SMCR_SMS) == TIM_SMCR_SMS ? 0 : -EINVAL;
 }
 
 static const struct iio_enum stm32_trigger_mode_enum = {