linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Brandon Leong <bleong@codeaurora.org>
Cc: Daniel Walker <dwalker@codeaurora.org>,
	lrg@slimlogic.co.uk, davidb@codeaurora.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] regulator: debugfs: Adding debugfs functions into regulator framework
Date: Tue, 7 Dec 2010 22:37:15 +0000	[thread overview]
Message-ID: <20101207223714.GA10566@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <2f8efbbd2ab7f88aa40a9c22a1fec0dc.squirrel@www.codeaurora.org>

On Tue, Dec 07, 2010 at 02:04:02PM -0800, Brandon Leong wrote:

[Please don't top post, and please quote properly - I've added a layer
of quotation to my text.]

> So is it decided that we should use BUG_ON() now?

I'd prefer it, other people's mileage may vary.  But please do also
engage with the big picture stuff I was talking about.

> Also, regarding this issue:

> > > +        if (val)
> > > +                err_info = regulator_enable(data);
> > > +        else
> > > +                err_info = regulator_disable(data);

> > This isn't going to do what people expect - the refcounting really is
> > going to surprise people, especially as you read back the physical
> > enable/disable state through the same file.  Abuse of this file is
> > likely to confuse any actual consumers we have too.

> ----

> Could you clarify the issue with this? All I am doing here is if the user
> enters a "1", then enable, if the user enters a "0" then disable.

Right, but remember that the regulator API does refcounting.  Writing
to the file won't always have an immediate effect, it'll update the
refcount which may or may not do what's expected to the actual hardware.

One other thing: your code checks for operations before it creates files
but the operations may not be permitted by the constraints.

      reply	other threads:[~2010-12-07 22:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 20:52 [PATCH] regulator: debugfs: Adding debugfs functions into regulator framework Brandon Leong
2010-12-06 22:29 ` Mark Brown
2010-12-07  2:52   ` Daniel Walker
2010-12-07 11:57     ` Mark Brown
2010-12-07 22:04       ` Brandon Leong
2010-12-07 22:37         ` Mark Brown [this message]

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=20101207223714.GA10566@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=bleong@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=dwalker@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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;
as well as URLs for NNTP newsgroup(s).