public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Marcus Folkesson <marcus.folkesson@gmail.com>
Cc: Liam Girdwood <lrg@ti.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage
Date: Thu, 4 Aug 2011 21:26:01 +0900	[thread overview]
Message-ID: <20110804122559.GC9959@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1312457632-27075-3-git-send-email-marcus.folkesson@gmail.com>

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.

  reply	other threads:[~2011-08-04 12:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 11:33 [PATCH 0/4] regulator: tps65023: patch updates Marcus Folkesson
2011-08-04 11:33 ` [PATCH 1/4] regulator: tps65023: Fixes i2c configuration issues Marcus Folkesson
2011-08-04 12:13   ` Mark Brown
2011-08-04 13:39     ` Marcus Folkesson
2011-08-04 13:40       ` Mark Brown
2011-08-04 11:33 ` [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage Marcus Folkesson
2011-08-04 12:26   ` Mark Brown [this message]
2011-08-04 11:33 ` [PATCH 3/4] regulator: tps65023: Setting correct core regulator for tps65021 Marcus Folkesson
2011-08-04 12:26   ` Mark Brown
2011-08-04 11:33 ` [PATCH 4/4] regulator: tps65023: Added support for the similiar TPS65020 chip Marcus Folkesson
2011-08-04 12:27   ` Mark Brown
2011-08-08 16:39 ` [PATCH 0/4] regulator: tps65023: patch updates Liam Girdwood
  -- strict thread matches above, loose matches on Subject: below --
2011-08-08 18:29 [PATCHv3 0/4] Marcus Folkesson
2011-08-08 18:29 ` [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage Marcus Folkesson
2011-08-09  0:52   ` Mark Brown
2011-08-02 10:59 [PATCHv2 0/4] regulator: tps65023: patch updates Marcus Folkesson
2011-08-02 10:59 ` [PATCH 2/4] regulator: tps65023: Set missing bit for update core-voltage Marcus Folkesson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110804122559.GC9959@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=marcus.folkesson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox