mfd: max77620: Fix FPS switch statements
Subsystems (2)
PATCH 1/1 mfd: max77620: Fix FPS switch statements
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.
--- drivers/mfd/max77620.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mfd/max77620.c +2 -0
@@ -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 ; }
Signature · 1 line
1.9.1
Quoted 8 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.
Thanks for fixes.
Missed when converting if-else to switch.
Quoted 11 lines · Laxman Dewangan
Quoted 8 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.
Quoted 5 lines
Thanks for fixes.
Missed when converting if-else to switch.Reviewed-by Laxman Dewangan <[email protected]>
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
Signature · 1 line
nvpublic
Quoted 15 lines · Rhyland Klein
Quoted 14 lines · Laxman Dewangan
Quoted 8 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.Thanks for fixes.
Missed when converting if-else to switch.
Quoted 6 lines
Quoted 2 lines
Reviewed-by Laxman Dewangan <[email protected]>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.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 17 lines · Lee Jones
Quoted 15 lines · Rhyland Klein
Quoted 14 lines · Laxman Dewangan
Quoted 8 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.Thanks for fixes.
Missed when converting if-else to switch.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Reviewed-by Laxman Dewangan <[email protected]>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
Signature · 1 line
nvpublic
Quoted 17 lines · Lee Jones
Quoted 15 lines · Rhyland Klein
Quoted 14 lines · Laxman Dewangan
Quoted 8 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.Thanks for fixes.
Missed when converting if-else to switch.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Reviewed-by Laxman Dewangan <[email protected]>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.
Lee Jones
AppliedQuoted 8 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.
Quoted 4 lines
Signed-off-by Rhyland Klein <[email protected]>--- drivers/mfd/max77620.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to -fixes with Thierry and Laxman's Acks.
Quoted 20 lines
drivers/mfd/max77620.c +2
-0@@ -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 ; }
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 10 lines · Lee Jones
Quoted 8 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Rhyland Klein <[email protected]>--- 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
Signature · 1 line
nvpublic
Alexandre Courbot
Tested-byQuoted 16 lines · Rhyland Klein
Quoted 15 lines · Lee Jones
Quoted 12 lines · 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()andmax77620_get_fps_period_reg_value(). Namely, in the case ofchip->chip_id== MAX77620, it will set fps_[mix|max]_period but then fall through to the default switch case and return-EINVAL. Returning this frommax77620_config_fps()will cause probe to fail.Signed-off-by Rhyland Klein <[email protected]>--- drivers/mfd/max77620.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 5 lines
Quoted 2 lines
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: