Messages in this thread | | | Date | Thu, 4 Aug 2011 21:26:01 +0900 | From | Mark Brown <> | Subject | Re: [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage |
| |
On Thu, Aug 04, 2011 at 01:33:50PM +0200, Marcus Folkesson wrote:
> + if (vsel == tps->info[dcdc]->table_len) { > + ret = -EINVAL; > + } else { > + ret = tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel); > + > + /* Tell the chip that we have changed the value in DEFCORE > + * and its time to update the core voltage > + */ > + tps_65023_set_bits(tps, TPS65023_REG_CON_CTRL2, > + TPS65023_REG_CTRL2_GO); > + } > + > + return ret;
This seems convoluted and non-scalable if we add more things here - it'd seem to be better to return an error and then have the write and so on as part of the regular function rather than putting them within the else clause.
| |