* [PATCH v2] regulator: tps65910: Add missing breaks in switch/case
@ 2011-07-10 10:41 Axel Lin
2011-07-10 11:09 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2011-07-10 10:41 UTC (permalink / raw)
To: linux-kernel; +Cc: Graeme Gregory, Liam Girdwood, Mark Brown
Also add a default case in tps65910_list_voltage_dcdc to silence
'volt' may be used uninitialized in this function warning.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
v2: Just found another missing breaks in tps65910_list_voltage_dcdc.
And also silence the 'volt' may be used uninitialized warning by
adding a default case.
drivers/regulator/tps65910-regulator.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 55dd4e6..fe8dc02 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -759,8 +759,12 @@ static int tps65910_list_voltage_dcdc(struct regulator_dev *dev,
mult = (selector / VDD1_2_NUM_VOLTS) + 1;
volt = VDD1_2_MIN_VOLT +
(selector % VDD1_2_NUM_VOLTS) * VDD1_2_OFFSET;
+ break;
case TPS65911_REG_VDDCTRL:
volt = VDDCTRL_MIN_VOLT + (selector * VDDCTRL_OFFSET);
+ break;
+ default:
+ return -EINVAL;
}
return volt * 100 * mult;
@@ -898,9 +902,11 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
case TPS65910:
pmic->get_ctrl_reg = &tps65910_get_ctrl_register;
info = tps65910_regs;
+ break;
case TPS65911:
pmic->get_ctrl_reg = &tps65911_get_ctrl_register;
info = tps65911_regs;
+ break;
default:
pr_err("Invalid tps chip version\n");
return -ENODEV;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] regulator: tps65910: Add missing breaks in switch/case
2011-07-10 10:41 [PATCH v2] regulator: tps65910: Add missing breaks in switch/case Axel Lin
@ 2011-07-10 11:09 ` Mark Brown
2011-07-22 10:47 ` Liam Girdwood
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2011-07-10 11:09 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Graeme Gregory, Liam Girdwood
On Sun, Jul 10, 2011 at 06:41:22PM +0800, Axel Lin wrote:
> Also add a default case in tps65910_list_voltage_dcdc to silence
> 'volt' may be used uninitialized in this function warning.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
though for the default case I'd suggest also adding a BUG() as if that
happens either the driver is confused or the core is making up
regulators for us.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] regulator: tps65910: Add missing breaks in switch/case
2011-07-10 11:09 ` Mark Brown
@ 2011-07-22 10:47 ` Liam Girdwood
0 siblings, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-07-22 10:47 UTC (permalink / raw)
To: Mark Brown; +Cc: Axel Lin, linux-kernel, Graeme Gregory, Liam Girdwood
On Sun, 2011-07-10 at 20:09 +0900, Mark Brown wrote:
> On Sun, Jul 10, 2011 at 06:41:22PM +0800, Axel Lin wrote:
> > Also add a default case in tps65910_list_voltage_dcdc to silence
> > 'volt' may be used uninitialized in this function warning.
> >
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> though for the default case I'd suggest also adding a BUG() as if that
> happens either the driver is confused or the core is making up
> regulators for us.
> --
Applied.
Thanks
Liam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-22 10:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-10 10:41 [PATCH v2] regulator: tps65910: Add missing breaks in switch/case Axel Lin
2011-07-10 11:09 ` Mark Brown
2011-07-22 10:47 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox