mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>,
	milo.kim@ti.com, support.opensource@diasemi.com,
	patches@opensource.wolfsonmicro.com, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: drivers: fix return value of get_mode callback
Date: Mon, 14 Jul 2014 19:01:14 +0100	[thread overview]
Message-ID: <20140714180114.GJ6800@sirena.org.uk> (raw)
In-Reply-To: <20140714115718.GA18724@opensource.wolfsonmicro.com>

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

On Mon, Jul 14, 2014 at 12:57:18PM +0100, Charles Keepax wrote:
> On Mon, Jul 14, 2014 at 04:03:17PM +0530, Laxman Dewangan wrote:

> > The function get_mode() should return 0 on error and REGULATOR_MODE_*
> > on success. The return type of this function is defined as unsigned int.

> Looks like _regulator_get_mode in core.c would need updated too.
> I can't help but wonder if it might be better to just make
> get/set mode use an int instead, although I don't know for what
> reasons an unsigned int was choosen in the first place so I might
> be missing something.

It's because it's returning something defined as a bitmask, though since
we don't even have enough modes for 8 bits that's not really a strong
reason and we should just be returning an error code as everyone is
clearly already assuming we do.

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

  reply	other threads:[~2014-07-14 18:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 10:33 Laxman Dewangan
2014-07-14 11:57 ` Charles Keepax
2014-07-14 18:01   ` Mark Brown [this message]
2014-07-24  9:45     ` Laxman Dewangan
2014-07-25 17:51       ` Mark Brown

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=20140714180114.GJ6800@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=ldewangan@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milo.kim@ti.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=support.opensource@diasemi.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

all inboxes | Powered by JetHome®