}
config->nr_states = i;
- ------ of_property_read_string(np, "regulator-type", ®type);
- ------
- ------ if (!strncmp("voltage", regtype, 7))
- ------ config->type = REGULATOR_VOLTAGE;
- ------ else if (!strncmp("current", regtype, 7))
- ------ config->type = REGULATOR_CURRENT;
++ +++++++ config->type = REGULATOR_VOLTAGE;
+ ++++++ ret = of_property_read_string(np, "regulator-type", ®type);
- - if (ret < 0) {
- - dev_err(dev, "Missing 'regulator-type' property\n");
- - return ERR_PTR(-EINVAL);
++ +++++++ if (ret >= 0) {
++ +++++++ if (!strncmp("voltage", regtype, 7))
++ +++++++ config->type = REGULATOR_VOLTAGE;
++ +++++++ else if (!strncmp("current", regtype, 7))
++ +++++++ config->type = REGULATOR_CURRENT;
++ +++++++ else
++ +++++++ dev_warn(dev, "Unknown regulator-type '%s'\n",
++ +++++++ regtype);
+ ++++++ }
- - if (!strncmp("voltage", regtype, 7))
- - config->type = REGULATOR_VOLTAGE;
- - else if (!strncmp("current", regtype, 7))
- - config->type = REGULATOR_CURRENT;
- -
return config;
}
if (ret)
return ret;
-------- if (value & 0x0f) {
++++++++ switch (value & 0x0f) {
- /* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */
- case 0x8:
- dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8");
- case 0x0:
- break;
- default:
- dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);
- return -ENODEV;
+++++++++ /*
+++++++++ * Freescale misprogrammed 1-3% of parts prior to week 8 of 2013
+++++++++ * as ID=8
+++++++++ */
+++++++++ case 0x8:
+++++++++ dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8");
+++++++++ case 0x0:
+++++++++ break;
+++++++++ default:
+ dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value);
+ return -ENODEV;
}
ret = regmap_read(pfuze_chip->regmap, PFUZE100_REVID, &value);