Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753294AbdHIOmB (ORCPT ); Wed, 9 Aug 2017 10:42:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:45786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751972AbdHIOl7 (ORCPT ); Wed, 9 Aug 2017 10:41:59 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF1ED22BCD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Wed, 9 Aug 2017 15:41:39 +0100 From: Jonathan Cameron To: Fabrice Gasnier Cc: , , , , , , , , , Subject: Re: [PATCH] iio: trigger: stm32-timer: fix get trigger mode Message-ID: <20170809154139.56259949@archlinux> In-Reply-To: <1501752137-14534-1-git-send-email-fabrice.gasnier@st.com> References: <1501752137-14534-1-git-send-email-fabrice.gasnier@st.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1100 Lines: 32 On Thu, 3 Aug 2017 11:22:17 +0200 Fabrice Gasnier wrote: > 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") > > Signed-off-by: Fabrice Gasnier Applied to the fixes-togreg branch of iio.git. THanks, Jonathan > --- > drivers/iio/trigger/stm32-timer-trigger.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c > index 14e6eb0..25ad6ab 100644 > --- a/drivers/iio/trigger/stm32-timer-trigger.c > +++ b/drivers/iio/trigger/stm32-timer-trigger.c > @@ -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 = {