linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: max77620: Fix FPS switch statements
@ 2016-05-12 17:45 Rhyland Klein
  2016-05-12 17:52 ` Laxman Dewangan
  2016-06-07  8:05 ` Lee Jones
  0 siblings, 2 replies; 9+ messages in thread
From: Rhyland Klein @ 2016-05-12 17:45 UTC (permalink / raw)
  To: Lee Jones; +Cc: Laxman Dewangan, linux-tegra, linux-kernel, Rhyland Klein

When configuring FPS during probe, assuming a DT node is present for
FPS, the code can run into a problem with the switch statements in
max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
in the case of chip->chip_id == MAX77620, it will set
fps_[mix|max]_period but then fall through to the default switch case
and return -EINVAL. Returning this from max77620_config_fps() will
cause probe to fail.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/mfd/max77620.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
index 199d261990be..f32fbb8e8129 100644
--- a/drivers/mfd/max77620.c
+++ b/drivers/mfd/max77620.c
@@ -203,6 +203,7 @@ static int max77620_get_fps_period_reg_value(struct max77620_chip *chip,
 		break;
 	case MAX77620:
 		fps_min_period = MAX77620_FPS_PERIOD_MIN_US;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -236,6 +237,7 @@ static int max77620_config_fps(struct max77620_chip *chip,
 		break;
 	case MAX77620:
 		fps_max_period = MAX77620_FPS_PERIOD_MAX_US;
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-05-12 17:45 [PATCH] mfd: max77620: Fix FPS switch statements Rhyland Klein
@ 2016-05-12 17:52 ` Laxman Dewangan
  2016-05-27 20:31   ` Rhyland Klein
  2016-06-07  8:05 ` Lee Jones
  1 sibling, 1 reply; 9+ messages in thread
From: Laxman Dewangan @ 2016-05-12 17:52 UTC (permalink / raw)
  To: Rhyland Klein, Lee Jones; +Cc: linux-tegra, linux-kernel


On Thursday 12 May 2016 11:15 PM, Rhyland Klein wrote:
> When configuring FPS during probe, assuming a DT node is present for
> FPS, the code can run into a problem with the switch statements in
> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
> in the case of chip->chip_id == MAX77620, it will set
> fps_[mix|max]_period but then fall through to the default switch case
> and return -EINVAL. Returning this from max77620_config_fps() will
> cause probe to fail.
>

Thanks for fixes.
Missed when converting if-else to switch.

Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-05-12 17:52 ` Laxman Dewangan
@ 2016-05-27 20:31   ` Rhyland Klein
  2016-05-31  7:30     ` Lee Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Rhyland Klein @ 2016-05-27 20:31 UTC (permalink / raw)
  To: Laxman Dewangan, Lee Jones; +Cc: linux-tegra, linux-kernel

On 5/12/2016 1:52 PM, Laxman Dewangan wrote:
> 
> On Thursday 12 May 2016 11:15 PM, Rhyland Klein wrote:
>> When configuring FPS during probe, assuming a DT node is present for
>> FPS, the code can run into a problem with the switch statements in
>> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
>> in the case of chip->chip_id == MAX77620, it will set
>> fps_[mix|max]_period but then fall through to the default switch case
>> and return -EINVAL. Returning this from max77620_config_fps() will
>> cause probe to fail.
>>
> 
> Thanks for fixes.
> Missed when converting if-else to switch.
> 
> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
> 

Lee, I noticed this hasn't been merged yet, but without it platforms
using the max77620 can easily (if it has FPS nodes) fail to probe. Is
there anything blocking it?

-rhyland

-- 
nvpublic

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-05-27 20:31   ` Rhyland Klein
@ 2016-05-31  7:30     ` Lee Jones
  2016-06-01 15:29       ` Rhyland Klein
  2016-06-06 15:32       ` Thierry Reding
  0 siblings, 2 replies; 9+ messages in thread
From: Lee Jones @ 2016-05-31  7:30 UTC (permalink / raw)
  To: Rhyland Klein; +Cc: Laxman Dewangan, linux-tegra, linux-kernel

On Fri, 27 May 2016, Rhyland Klein wrote:

> On 5/12/2016 1:52 PM, Laxman Dewangan wrote:
> > 
> > On Thursday 12 May 2016 11:15 PM, Rhyland Klein wrote:
> >> When configuring FPS during probe, assuming a DT node is present for
> >> FPS, the code can run into a problem with the switch statements in
> >> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
> >> in the case of chip->chip_id == MAX77620, it will set
> >> fps_[mix|max]_period but then fall through to the default switch case
> >> and return -EINVAL. Returning this from max77620_config_fps() will
> >> cause probe to fail.
> >>
> > 
> > Thanks for fixes.
> > Missed when converting if-else to switch.
> > 
> > Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
> > 
> 
> Lee, I noticed this hasn't been merged yet, but without it platforms
> using the max77620 can easily (if it has FPS nodes) fail to probe. Is
> there anything blocking it?

Yes, it was sent too late in the cycle.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-05-31  7:30     ` Lee Jones
@ 2016-06-01 15:29       ` Rhyland Klein
  2016-06-06 15:32       ` Thierry Reding
  1 sibling, 0 replies; 9+ messages in thread
From: Rhyland Klein @ 2016-06-01 15:29 UTC (permalink / raw)
  To: Lee Jones; +Cc: Laxman Dewangan, linux-tegra, linux-kernel

On 5/31/2016 3:30 AM, Lee Jones wrote:
> On Fri, 27 May 2016, Rhyland Klein wrote:
> 
>> On 5/12/2016 1:52 PM, Laxman Dewangan wrote:
>>>
>>> On Thursday 12 May 2016 11:15 PM, Rhyland Klein wrote:
>>>> When configuring FPS during probe, assuming a DT node is present for
>>>> FPS, the code can run into a problem with the switch statements in
>>>> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
>>>> in the case of chip->chip_id == MAX77620, it will set
>>>> fps_[mix|max]_period but then fall through to the default switch case
>>>> and return -EINVAL. Returning this from max77620_config_fps() will
>>>> cause probe to fail.
>>>>
>>>
>>> Thanks for fixes.
>>> Missed when converting if-else to switch.
>>>
>>> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
>>>
>>
>> Lee, I noticed this hasn't been merged yet, but without it platforms
>> using the max77620 can easily (if it has FPS nodes) fail to probe. Is
>> there anything blocking it?
> 
> Yes, it was sent too late in the cycle.
> 

Ok, thanks.

-rhyland

-- 
nvpublic

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-05-31  7:30     ` Lee Jones
  2016-06-01 15:29       ` Rhyland Klein
@ 2016-06-06 15:32       ` Thierry Reding
  1 sibling, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2016-06-06 15:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: Rhyland Klein, Laxman Dewangan, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

On Tue, May 31, 2016 at 08:30:22AM +0100, Lee Jones wrote:
> On Fri, 27 May 2016, Rhyland Klein wrote:
> 
> > On 5/12/2016 1:52 PM, Laxman Dewangan wrote:
> > > 
> > > On Thursday 12 May 2016 11:15 PM, Rhyland Klein wrote:
> > >> When configuring FPS during probe, assuming a DT node is present for
> > >> FPS, the code can run into a problem with the switch statements in
> > >> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
> > >> in the case of chip->chip_id == MAX77620, it will set
> > >> fps_[mix|max]_period but then fall through to the default switch case
> > >> and return -EINVAL. Returning this from max77620_config_fps() will
> > >> cause probe to fail.
> > >>
> > > 
> > > Thanks for fixes.
> > > Missed when converting if-else to switch.
> > > 
> > > Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
> > > 
> > 
> > Lee, I noticed this hasn't been merged yet, but without it platforms
> > using the max77620 can easily (if it has FPS nodes) fail to probe. Is
> > there anything blocking it?
> 
> Yes, it was sent too late in the cycle.

Can we still have this for v4.7? It's clearly -rc material.

Reviewed-by: Thierry Reding <treding@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-05-12 17:45 [PATCH] mfd: max77620: Fix FPS switch statements Rhyland Klein
  2016-05-12 17:52 ` Laxman Dewangan
@ 2016-06-07  8:05 ` Lee Jones
  2016-06-14 16:50   ` Rhyland Klein
  1 sibling, 1 reply; 9+ messages in thread
From: Lee Jones @ 2016-06-07  8:05 UTC (permalink / raw)
  To: Rhyland Klein; +Cc: Laxman Dewangan, linux-tegra, linux-kernel

On Thu, 12 May 2016, Rhyland Klein wrote:

> When configuring FPS during probe, assuming a DT node is present for
> FPS, the code can run into a problem with the switch statements in
> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
> in the case of chip->chip_id == MAX77620, it will set
> fps_[mix|max]_period but then fall through to the default switch case
> and return -EINVAL. Returning this from max77620_config_fps() will
> cause probe to fail.
> 
> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
> ---
>  drivers/mfd/max77620.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied to -fixes with Thierry and Laxman's Acks.

> diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
> index 199d261990be..f32fbb8e8129 100644
> --- a/drivers/mfd/max77620.c
> +++ b/drivers/mfd/max77620.c
> @@ -203,6 +203,7 @@ static int max77620_get_fps_period_reg_value(struct max77620_chip *chip,
>  		break;
>  	case MAX77620:
>  		fps_min_period = MAX77620_FPS_PERIOD_MIN_US;
> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> @@ -236,6 +237,7 @@ static int max77620_config_fps(struct max77620_chip *chip,
>  		break;
>  	case MAX77620:
>  		fps_max_period = MAX77620_FPS_PERIOD_MAX_US;
> +		break;
>  	default:
>  		return -EINVAL;
>  	}

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-06-07  8:05 ` Lee Jones
@ 2016-06-14 16:50   ` Rhyland Klein
  2016-06-15  6:11     ` Alexandre Courbot
  0 siblings, 1 reply; 9+ messages in thread
From: Rhyland Klein @ 2016-06-14 16:50 UTC (permalink / raw)
  To: Lee Jones; +Cc: Laxman Dewangan, linux-tegra, linux-kernel

On 6/7/2016 4:05 AM, Lee Jones wrote:
> On Thu, 12 May 2016, Rhyland Klein wrote:
> 
>> When configuring FPS during probe, assuming a DT node is present for
>> FPS, the code can run into a problem with the switch statements in
>> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
>> in the case of chip->chip_id == MAX77620, it will set
>> fps_[mix|max]_period but then fall through to the default switch case
>> and return -EINVAL. Returning this from max77620_config_fps() will
>> cause probe to fail.
>>
>> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
>> ---
>>  drivers/mfd/max77620.c | 2 ++
>>  1 file changed, 2 insertions(+)
> 
> Applied to -fixes with Thierry and Laxman's Acks.
> 

I don't see this in linux-next yet (as of 20160614). Can we get this
merged there to.

-rhyland

-- 
nvpublic

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] mfd: max77620: Fix FPS switch statements
  2016-06-14 16:50   ` Rhyland Klein
@ 2016-06-15  6:11     ` Alexandre Courbot
  0 siblings, 0 replies; 9+ messages in thread
From: Alexandre Courbot @ 2016-06-15  6:11 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Lee Jones, Laxman Dewangan, linux-tegra, Linux Kernel Mailing List

On Wed, Jun 15, 2016 at 1:50 AM, Rhyland Klein <rklein@nvidia.com> wrote:
> On 6/7/2016 4:05 AM, Lee Jones wrote:
>> On Thu, 12 May 2016, Rhyland Klein wrote:
>>
>>> When configuring FPS during probe, assuming a DT node is present for
>>> FPS, the code can run into a problem with the switch statements in
>>> max77620_config_fps() and max77620_get_fps_period_reg_value(). Namely,
>>> in the case of chip->chip_id == MAX77620, it will set
>>> fps_[mix|max]_period but then fall through to the default switch case
>>> and return -EINVAL. Returning this from max77620_config_fps() will
>>> cause probe to fail.
>>>
>>> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
>>> ---
>>>  drivers/mfd/max77620.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>
>> Applied to -fixes with Thierry and Laxman's Acks.
>>
>
> I don't see this in linux-next yet (as of 20160614). Can we get this
> merged there to.

Was about to say the same thing. FWIW:

Tested-by: Alexandre Courbot <acourbot@nvidia.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-06-15  6:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-12 17:45 [PATCH] mfd: max77620: Fix FPS switch statements Rhyland Klein
2016-05-12 17:52 ` Laxman Dewangan
2016-05-27 20:31   ` Rhyland Klein
2016-05-31  7:30     ` Lee Jones
2016-06-01 15:29       ` Rhyland Klein
2016-06-06 15:32       ` Thierry Reding
2016-06-07  8:05 ` Lee Jones
2016-06-14 16:50   ` Rhyland Klein
2016-06-15  6:11     ` Alexandre Courbot

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).