public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Sundar Iyer <sundar.iyer@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
	STEricsson_nomadik_linux@list.st.com,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH 1/1] regulator: return set_mode is same mode is requested
Date: Mon, 17 May 2010 07:44:13 -0700	[thread overview]
Message-ID: <20100517144411.GD5257@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1274105393-32197-1-git-send-email-sundar.iyer@stericsson.com>

On Mon, May 17, 2010 at 07:39:53PM +0530, Sundar Iyer wrote:
> From: Sundar R Iyer <sundar.iyer@stericsson.com>

The commit message reads "regulator: return set_mode is same mode is
requested".  I'm having a hard time parsing what that actually means,
you probably need a "when" in there...

> +	/* return if the same mode is requested */
> +	regulator_curr_mode = rdev->desc->ops->get_mode(rdev);
> +	if (regulator_curr_mode == mode) {
> +		ret = 0;
> +		goto out;
> +	}
> +

This is going to oops if the regulator doesn't implement a get_mode()
operation.  

I'm also a little ambivalent on the benefit of it - if the goal is to
save I/O costs (you didn't say...) it's not clear to me that the effort
of checking the current mode is going to be a win in situations where
the mode is actually being changed a lot.

As I said in reply to your previous message the trend is away from
having any mode configration at all, with regulators being able to adapt
to their current load without any software assistance.

  parent reply	other threads:[~2010-05-17 14:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17 14:09 [PATCH 1/1] regulator: return set_mode is same mode is requested Sundar Iyer
2010-05-17 14:35 ` Liam Girdwood
2010-05-17 14:44 ` Mark Brown [this message]
2010-05-17 14:56   ` Sundar R Iyer
2010-05-17 15:15     ` Sundar R Iyer
2010-05-17 15:34       ` Mark Brown
2010-05-17 15:54         ` Sundar R Iyer
2010-05-17 16:08           ` Mark Brown
2010-05-17 19:44           ` Liam Girdwood
2010-05-17 15:18     ` Sundar R Iyer

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=20100517144411.GD5257@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=sundar.iyer@stericsson.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