All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Tero Kristo <t-kristo@ti.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Liam Girdwood <lrg@ti.com>, Samuel Ortiz <sameo@linux.intel.com>,
	Kevin Hilman <khilman@ti.com>
Subject: Re: [PATCH] regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators
Date: Thu, 23 Feb 2012 15:34:22 +0000	[thread overview]
Message-ID: <20120223153422.GF4553@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1329995109-4795-1-git-send-email-t-kristo@ti.com>

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

On Thu, Feb 23, 2012 at 01:05:09PM +0200, Tero Kristo wrote:

> +static int twl6030coresmps_set_voltage(struct regulator_dev *rdev, int min_uV,
> +	int max_uV, unsigned *selector)
> +{
> +	struct twlreg_info *info = rdev_get_drvdata(rdev);
> +
> +	if (info->set_voltage)
> +		return info->set_voltage(info->data, min_uV);
> +
> +	return 0;
> +}

This should be returning an error if it failed to set the voltage.
Since you're using min_uV as the "register value" you probably ought to
be returning that as the selector too and supplying a list_voltage()
which just passes the selector back in case something tries to use it
and gets confused.

> +static int twl6030coresmps_get_voltage(struct regulator_dev *rdev)
> +{
> +	struct twlreg_info *info = rdev_get_drvdata(rdev);
> +
> +	if (info->get_voltage)
> +		return info->get_voltage(info->data);
> +
> +	return 0;

Similarly here.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators
Date: Thu, 23 Feb 2012 15:34:22 +0000	[thread overview]
Message-ID: <20120223153422.GF4553@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1329995109-4795-1-git-send-email-t-kristo@ti.com>

On Thu, Feb 23, 2012 at 01:05:09PM +0200, Tero Kristo wrote:

> +static int twl6030coresmps_set_voltage(struct regulator_dev *rdev, int min_uV,
> +	int max_uV, unsigned *selector)
> +{
> +	struct twlreg_info *info = rdev_get_drvdata(rdev);
> +
> +	if (info->set_voltage)
> +		return info->set_voltage(info->data, min_uV);
> +
> +	return 0;
> +}

This should be returning an error if it failed to set the voltage.
Since you're using min_uV as the "register value" you probably ought to
be returning that as the selector too and supplying a list_voltage()
which just passes the selector back in case something tries to use it
and gets confused.

> +static int twl6030coresmps_get_voltage(struct regulator_dev *rdev)
> +{
> +	struct twlreg_info *info = rdev_get_drvdata(rdev);
> +
> +	if (info->get_voltage)
> +		return info->get_voltage(info->data);
> +
> +	return 0;

Similarly here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120223/7a7b9d61/attachment-0001.sig>

  reply	other threads:[~2012-02-23 15:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 11:05 [PATCH] regulator: twl6030: add support for vdd1, vdd2 and vdd3 regulators Tero Kristo
2012-02-23 11:05 ` Tero Kristo
2012-02-23 15:34 ` Mark Brown [this message]
2012-02-23 15:34   ` Mark Brown
2012-02-24  9:38   ` Tero Kristo
2012-02-24  9:38     ` Tero Kristo
2012-02-24 11:49     ` Mark Brown
2012-02-24 11:49       ` Mark Brown
2012-02-24 13:16       ` Tero Kristo
2012-02-24 13:16         ` Tero Kristo
2012-02-24 13:24         ` Mark Brown
2012-02-24 13:24           ` Mark Brown
2012-02-24 13:56           ` Tero Kristo
2012-02-24 13:56             ` Tero Kristo
2012-02-24 14:01             ` Mark Brown
2012-02-24 14:01               ` Mark Brown
2012-02-24 14:25               ` Tero Kristo
2012-02-24 14:25                 ` Tero Kristo
2012-02-24 14:34                 ` Mark Brown
2012-02-24 14:34                   ` Mark Brown
2012-02-24 14:42                   ` Tero Kristo
2012-02-24 14:42                     ` Tero Kristo
2012-02-24 14:50                     ` Mark Brown
2012-02-24 14:50                       ` Mark Brown
2012-02-24 15:04                       ` Tero Kristo
2012-02-24 15:04                         ` Tero Kristo

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=20120223153422.GF4553@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=t-kristo@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.