* [PATCH] counter: stm32: clean up indentation issue
@ 2019-09-25 9:51 Colin King
2019-10-05 17:30 ` William Breathitt Gray
0 siblings, 1 reply; 4+ messages in thread
From: Colin King @ 2019-09-25 9:51 UTC (permalink / raw)
To: Fabrice Gasnier, William Breathitt Gray, Maxime Coquelin,
Alexandre Torgue, linux-iio, linux-stm32, linux-arm-kernel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
There is an if statement that is indented one level too deeply,
remove the extraneous tabs.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/counter/stm32-timer-cnt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
index 644ba18a72ad..613dcccf79e1 100644
--- a/drivers/counter/stm32-timer-cnt.c
+++ b/drivers/counter/stm32-timer-cnt.c
@@ -219,8 +219,8 @@ static ssize_t stm32_count_enable_write(struct counter_device *counter,
if (enable) {
regmap_read(priv->regmap, TIM_CR1, &cr1);
- if (!(cr1 & TIM_CR1_CEN))
- clk_enable(priv->clk);
+ if (!(cr1 & TIM_CR1_CEN))
+ clk_enable(priv->clk);
regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN,
TIM_CR1_CEN);
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] counter: stm32: clean up indentation issue
2019-09-25 9:51 [PATCH] counter: stm32: clean up indentation issue Colin King
@ 2019-10-05 17:30 ` William Breathitt Gray
2019-10-06 8:46 ` Jonathan Cameron
2019-10-07 7:31 ` Fabrice Gasnier
0 siblings, 2 replies; 4+ messages in thread
From: William Breathitt Gray @ 2019-10-05 17:30 UTC (permalink / raw)
To: Colin King, Jonathan Cameron, Fabrice Gasnier
Cc: Maxime Coquelin, Alexandre Torgue, linux-iio, linux-stm32,
linux-arm-kernel, kernel-janitors, linux-kernel
On Wed, Sep 25, 2019 at 10:51:26AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> There is an if statement that is indented one level too deeply,
> remove the extraneous tabs.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/counter/stm32-timer-cnt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
> index 644ba18a72ad..613dcccf79e1 100644
> --- a/drivers/counter/stm32-timer-cnt.c
> +++ b/drivers/counter/stm32-timer-cnt.c
> @@ -219,8 +219,8 @@ static ssize_t stm32_count_enable_write(struct counter_device *counter,
>
> if (enable) {
> regmap_read(priv->regmap, TIM_CR1, &cr1);
> - if (!(cr1 & TIM_CR1_CEN))
> - clk_enable(priv->clk);
> + if (!(cr1 & TIM_CR1_CEN))
> + clk_enable(priv->clk);
>
> regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN,
> TIM_CR1_CEN);
> --
> 2.20.1
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Fabrice,
I noticed the TIM_CR1_CEN check is happening before the
regmap_update_bits call for the enable path, while the disable path does
the check after. Is this logic is correct.
William Breathitt Gray
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] counter: stm32: clean up indentation issue
2019-10-05 17:30 ` William Breathitt Gray
@ 2019-10-06 8:46 ` Jonathan Cameron
2019-10-07 7:31 ` Fabrice Gasnier
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2019-10-06 8:46 UTC (permalink / raw)
To: William Breathitt Gray
Cc: Colin King, Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue,
linux-iio, linux-stm32, linux-arm-kernel, kernel-janitors,
linux-kernel
On Sat, 5 Oct 2019 13:30:04 -0400
William Breathitt Gray <vilhelm.gray@gmail.com> wrote:
> On Wed, Sep 25, 2019 at 10:51:26AM +0100, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > There is an if statement that is indented one level too deeply,
> > remove the extraneous tabs.
> >
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> > drivers/counter/stm32-timer-cnt.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
> > index 644ba18a72ad..613dcccf79e1 100644
> > --- a/drivers/counter/stm32-timer-cnt.c
> > +++ b/drivers/counter/stm32-timer-cnt.c
> > @@ -219,8 +219,8 @@ static ssize_t stm32_count_enable_write(struct counter_device *counter,
> >
> > if (enable) {
> > regmap_read(priv->regmap, TIM_CR1, &cr1);
> > - if (!(cr1 & TIM_CR1_CEN))
> > - clk_enable(priv->clk);
> > + if (!(cr1 & TIM_CR1_CEN))
> > + clk_enable(priv->clk);
> >
> > regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN,
> > TIM_CR1_CEN);
> > --
> > 2.20.1
>
> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to poke it.
Thanks,
Jonathan
>
> Fabrice,
>
> I noticed the TIM_CR1_CEN check is happening before the
> regmap_update_bits call for the enable path, while the disable path does
> the check after. Is this logic is correct.
>
> William Breathitt Gray
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] counter: stm32: clean up indentation issue
2019-10-05 17:30 ` William Breathitt Gray
2019-10-06 8:46 ` Jonathan Cameron
@ 2019-10-07 7:31 ` Fabrice Gasnier
1 sibling, 0 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2019-10-07 7:31 UTC (permalink / raw)
To: William Breathitt Gray
Cc: Colin King, Jonathan Cameron, Maxime Coquelin, Alexandre Torgue,
linux-iio, linux-stm32, linux-arm-kernel, kernel-janitors,
linux-kernel
On 10/5/19 7:30 PM, William Breathitt Gray wrote:
> On Wed, Sep 25, 2019 at 10:51:26AM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> There is an if statement that is indented one level too deeply,
>> remove the extraneous tabs.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>> drivers/counter/stm32-timer-cnt.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c
>> index 644ba18a72ad..613dcccf79e1 100644
>> --- a/drivers/counter/stm32-timer-cnt.c
>> +++ b/drivers/counter/stm32-timer-cnt.c
>> @@ -219,8 +219,8 @@ static ssize_t stm32_count_enable_write(struct counter_device *counter,
>>
>> if (enable) {
>> regmap_read(priv->regmap, TIM_CR1, &cr1);
>> - if (!(cr1 & TIM_CR1_CEN))
>> - clk_enable(priv->clk);
>> + if (!(cr1 & TIM_CR1_CEN))
>> + clk_enable(priv->clk);
>>
>> regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN,
>> TIM_CR1_CEN);
>> --
>> 2.20.1
>
> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
>
> Fabrice,
>
> I noticed the TIM_CR1_CEN check is happening before the
> regmap_update_bits call for the enable path, while the disable path does
> the check after. Is this logic is correct.
Hi William,
In the disable path, things are done in the reverse order, purpose is to:
- enable the clock before enabling the counter (CEN)
- disable the clock after the counter has been disabled
Current code also takes care of balancing clock enable/disable calls.
BR,
Fabrice
>
> William Breathitt Gray
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-07 7:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 9:51 [PATCH] counter: stm32: clean up indentation issue Colin King
2019-10-05 17:30 ` William Breathitt Gray
2019-10-06 8:46 ` Jonathan Cameron
2019-10-07 7:31 ` Fabrice Gasnier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).