linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: avorontsov@ru.mvista.com
Cc: Stefan Roese <sr@denx.de>,
	"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH v6] PPC440EPx gpio driver
Date: Thu, 9 Oct 2008 17:12:41 -0700	[thread overview]
Message-ID: <200810091712.42155.david-b@pacbell.net> (raw)
In-Reply-To: <20081009211852.GA23903@oksana.dev.rtsoft.ru>

On Thursday 09 October 2008, Anton Vorontsov wrote:
> 
> > I've incorporated the other changes, with one exception.  I want
> > ppc4xx_gpio_get() to return 0 or 1 (rather than Anton's comment that any
> > non-zero value is ok), because when you use the new "export feature" in
> > sysfs, you see the raw value returned from ppc4xx_gpio_get().  So, without
> > the !!  in the return statement, you would see a strange value, like 32768
> > instead of 1:
> > 
> >       # cd gpio208
> >       # cat value
> >       32768
> > 
> > So, I think it is worth sanitizing the return value here.
> 
> I think that nonzero == high assumption is also ok for the userspace.

Actually, I was thinking that userspace might be happier
not having to deal with that ... so that's worth changing
in the sysfs glue.  I'd sign off on a patch fixing that.

I seem to recall seeing an explicit policy saying sysfs
exports booleans as 0/1, at some point, though I can't
find it just now.

- Dave

  reply	other threads:[~2008-10-10  2:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 20:05 [PATCH v6] PPC440EPx gpio driver Steven A. Falco
2008-10-09 21:18 ` Anton Vorontsov
2008-10-10  0:12   ` David Brownell [this message]
2008-10-10  6:44 ` Stefan Roese

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=200810091712.42155.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=avorontsov@ru.mvista.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sr@denx.de \
    /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).