lkml.org 
[lkml]   [2011]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2011-08-04 14:41    [W:0.586 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site