aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDiego Liziero <diegoliz@gmail.com>2009-04-13 21:04:47 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-04-28 13:58:07 -0400
commitcd78dfc6c6e321a310a73ef7b0df3d262704dd55 (patch)
tree9b54c41207160b04946a7984dfc863167afc1b1b /drivers
parent036de8efae4b81f8e1504fab654070cecce6dfa9 (diff)
drivers/regulator: fix when type is different from REGULATOR_VOLTAGE or REGULATOR_CURRENT
When regulator_desc->type is something different from REGULATOR_VOLTAGE or REGULATOR_CURRENT the if should probably return ERR_PTR(-EINVAL) The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) @@ expression E; constant C; @@ ( - !E == C + E != C ) Signed-off-by: Diego Liziero <diegoliz@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 47fc6e6fe9bc..cb62be63caed 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2001,8 +2001,8 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
2001 if (regulator_desc->name == NULL || regulator_desc->ops == NULL) 2001 if (regulator_desc->name == NULL || regulator_desc->ops == NULL)
2002 return ERR_PTR(-EINVAL); 2002 return ERR_PTR(-EINVAL);
2003 2003
2004 if (!regulator_desc->type == REGULATOR_VOLTAGE && 2004 if (regulator_desc->type != REGULATOR_VOLTAGE &&
2005 !regulator_desc->type == REGULATOR_CURRENT) 2005 regulator_desc->type != REGULATOR_CURRENT)
2006 return ERR_PTR(-EINVAL); 2006 return ERR_PTR(-EINVAL);
2007 2007
2008 if (!init_data) 2008 if (!init_data)