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>
This commit is contained in:
Diego Liziero 2009-04-14 03:04:47 +02:00 коммит произвёл Liam Girdwood
Родитель 036de8efae
Коммит cd78dfc6c6
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -2001,8 +2001,8 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
if (regulator_desc->name == NULL || regulator_desc->ops == NULL)
return ERR_PTR(-EINVAL);
if (!regulator_desc->type == REGULATOR_VOLTAGE &&
!regulator_desc->type == REGULATOR_CURRENT)
if (regulator_desc->type != REGULATOR_VOLTAGE &&
regulator_desc->type != REGULATOR_CURRENT)
return ERR_PTR(-EINVAL);
if (!init_data)