From: Fabrice Gasnier <fabrice.gasnier@st.com> To: William Breathitt Gray <vilhelm.gray@gmail.com>, <jic23@jic23.retrosnub.co.uk> Cc: <linux-kernel@vger.kernel.org>, <linux-iio@vger.kernel.org>, <patrick.havelange@essensium.com>, <mcoquelin.stm32@gmail.com>, <alexandre.torgue@st.com>, <linux-stm32@st-md-mailman.stormreply.com>, <linux-arm-kernel@lists.infradead.org> Subject: Re: [PATCH v2 7/7] counter: stm32-timer-cnt: Update count_read and count_write callbacks Date: Wed, 18 Sep 2019 14:16:38 +0200 [thread overview] Message-ID: <a5891ee5-162e-6a72-261d-e736f5088020@st.com> (raw) In-Reply-To: <327fe01b7ce4feb0fc3d854393691664a6a36b40.1568792697.git.vilhelm.gray@gmail.com> On 9/18/19 9:52 AM, William Breathitt Gray wrote: > The count_read and count_write callbacks pass unsigned long now. > > Cc: Fabrice Gasnier <fabrice.gasnier@st.com> > Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Hi William, I tested your series for STM32 timer and LPtimer drivers. Maybe you can squash as suggested by Benjamin ? With that, you can add my acked-by for the two STM32 drivers. Thanks, Fabrice > --- > drivers/counter/stm32-timer-cnt.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > > diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c > index 644ba18a72ad..839083543323 100644 > --- a/drivers/counter/stm32-timer-cnt.c > +++ b/drivers/counter/stm32-timer-cnt.c > @@ -48,34 +48,27 @@ static enum counter_count_function stm32_count_functions[] = { > }; > > static int stm32_count_read(struct counter_device *counter, > - struct counter_count *count, > - struct counter_count_read_value *val) > + struct counter_count *count, unsigned long *val) > { > struct stm32_timer_cnt *const priv = counter->priv; > u32 cnt; > > regmap_read(priv->regmap, TIM_CNT, &cnt); > - counter_count_read_value_set(val, COUNTER_COUNT_POSITION, &cnt); > + *val = cnt; > > return 0; > } > > static int stm32_count_write(struct counter_device *counter, > struct counter_count *count, > - struct counter_count_write_value *val) > + const unsigned long val) > { > struct stm32_timer_cnt *const priv = counter->priv; > - u32 cnt; > - int err; > - > - err = counter_count_write_value_get(&cnt, COUNTER_COUNT_POSITION, val); > - if (err) > - return err; > > - if (cnt > priv->ceiling) > + if (val > priv->ceiling) > return -EINVAL; > > - return regmap_write(priv->regmap, TIM_CNT, cnt); > + return regmap_write(priv->regmap, TIM_CNT, val); > } > > static int stm32_count_function_get(struct counter_device *counter, >
WARNING: multiple messages have this Message-ID (diff)
From: Fabrice Gasnier <fabrice.gasnier@st.com> To: William Breathitt Gray <vilhelm.gray@gmail.com>, <jic23@jic23.retrosnub.co.uk> Cc: alexandre.torgue@st.com, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, linux-kernel@vger.kernel.org, mcoquelin.stm32@gmail.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 7/7] counter: stm32-timer-cnt: Update count_read and count_write callbacks Date: Wed, 18 Sep 2019 14:16:38 +0200 [thread overview] Message-ID: <a5891ee5-162e-6a72-261d-e736f5088020@st.com> (raw) In-Reply-To: <327fe01b7ce4feb0fc3d854393691664a6a36b40.1568792697.git.vilhelm.gray@gmail.com> On 9/18/19 9:52 AM, William Breathitt Gray wrote: > The count_read and count_write callbacks pass unsigned long now. > > Cc: Fabrice Gasnier <fabrice.gasnier@st.com> > Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Hi William, I tested your series for STM32 timer and LPtimer drivers. Maybe you can squash as suggested by Benjamin ? With that, you can add my acked-by for the two STM32 drivers. Thanks, Fabrice > --- > drivers/counter/stm32-timer-cnt.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > > diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c > index 644ba18a72ad..839083543323 100644 > --- a/drivers/counter/stm32-timer-cnt.c > +++ b/drivers/counter/stm32-timer-cnt.c > @@ -48,34 +48,27 @@ static enum counter_count_function stm32_count_functions[] = { > }; > > static int stm32_count_read(struct counter_device *counter, > - struct counter_count *count, > - struct counter_count_read_value *val) > + struct counter_count *count, unsigned long *val) > { > struct stm32_timer_cnt *const priv = counter->priv; > u32 cnt; > > regmap_read(priv->regmap, TIM_CNT, &cnt); > - counter_count_read_value_set(val, COUNTER_COUNT_POSITION, &cnt); > + *val = cnt; > > return 0; > } > > static int stm32_count_write(struct counter_device *counter, > struct counter_count *count, > - struct counter_count_write_value *val) > + const unsigned long val) > { > struct stm32_timer_cnt *const priv = counter->priv; > - u32 cnt; > - int err; > - > - err = counter_count_write_value_get(&cnt, COUNTER_COUNT_POSITION, val); > - if (err) > - return err; > > - if (cnt > priv->ceiling) > + if (val > priv->ceiling) > return -EINVAL; > > - return regmap_write(priv->regmap, TIM_CNT, cnt); > + return regmap_write(priv->regmap, TIM_CNT, val); > } > > static int stm32_count_function_get(struct counter_device *counter, > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-09-18 12:16 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-18 7:52 [PATCH v2 0/7] counter: Simplify count_read/count_write/signal_read William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 7:52 ` [PATCH v2 1/7] counter: Simplify the count_read and count_write callbacks William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 8:48 ` Benjamin Gaignard 2019-09-18 8:48 ` Benjamin Gaignard 2019-09-18 7:52 ` [PATCH v2 2/7] counter: Simplify the signal_read callback William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 7:52 ` [PATCH v2 3/7] docs: driver-api: generic-counter: Update Count and Signal data types William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 7:52 ` [PATCH v2 4/7] counter: 104-quad-8: Update count_read/count_write/signal_read callbacks William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 7:52 ` [PATCH v2 5/7] counter: ftm-quaddec: Update count_read and count_write callbacks William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 7:52 ` [PATCH v2 6/7] counter: stm32-lptimer-cnt: Update count_read callback William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 7:52 ` [PATCH v2 7/7] counter: stm32-timer-cnt: Update count_read and count_write callbacks William Breathitt Gray 2019-09-18 7:52 ` William Breathitt Gray 2019-09-18 12:16 ` Fabrice Gasnier [this message] 2019-09-18 12:16 ` Fabrice Gasnier 2019-09-18 8:11 ` [PATCH v2 0/7] counter: Simplify count_read/count_write/signal_read William Breathitt Gray 2019-09-18 8:11 ` William Breathitt Gray
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=a5891ee5-162e-6a72-261d-e736f5088020@st.com \ --to=fabrice.gasnier@st.com \ --cc=alexandre.torgue@st.com \ --cc=jic23@jic23.retrosnub.co.uk \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-iio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-stm32@st-md-mailman.stormreply.com \ --cc=mcoquelin.stm32@gmail.com \ --cc=patrick.havelange@essensium.com \ --cc=vilhelm.gray@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.