All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Trent Piepho <tpiepho@freescale.com>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [RFC] Dummy GPIO driver for use with SPI
Date: Tue, 16 Dec 2008 19:34:28 +0300	[thread overview]
Message-ID: <20081216163428.GA22756@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <Pine.LNX.4.64.0812121322110.28806@t2.domain.actdsltmp>

On Fri, Dec 12, 2008 at 01:39:45PM -0800, Trent Piepho wrote:
> On Fri, 12 Dec 2008, Anton Vorontsov wrote:
> > On Fri, Dec 12, 2008 at 11:59:13AM -0500, Steven A. Falco wrote:
> >> What do you think about having a mechanism to specify that some
> >> SPI slaves have a chip select, while others don't have to have a
> >> chip select managed by the SPI subsystem?
> >
> > Um.. do you know that you can pass '0' as a GPIO?
> >
> > For example,
> >
> > spi-controller {
> > 	gpios = <&pio1 1 0	/* cs0 */
> > 		 0		/* cs1, no GPIO */
> > 		 &pio2 2 0>;	/* cs2 */
> 
> It's ok the that middle specifier is only one word instead of three?  Seems
> like "0 0 0" would be better, so all the specifiers are the same size.
> 
> > 		normal case;
> > 	} else if (gpio == -EEXIST) {
> 
> Isn't EEXIST (pathname already exists) backward?

In my thinking it's "the GPIO is specified (exists in the list), but
it's would be an error if you try to use it". So EEXIST.

> Seems like ENOENT would
> be the right error code.  Except that's used for reading past the end...
> Maybe a reading past the end should be EINVAL or EBADF?
> 
> Or return ENODEV for the 'hole' cell?  Or ENOLINK?

I'd say it's a matter of taste, none of the errors are actually
appropriate. An appropriate errno value would be EHOLEINALIST,
but we don't have it.

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  parent reply	other threads:[~2008-12-16 16:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12 14:22 [RFC] Dummy GPIO driver for use with SPI Steven A. Falco
2008-12-12 15:01 ` Anton Vorontsov
2008-12-12 16:59   ` Steven A. Falco
2008-12-12 17:14     ` Anton Vorontsov
2008-12-12 17:33       ` Steven A. Falco
2008-12-12 21:39       ` Trent Piepho
2008-12-12 22:46         ` David Gibson
2008-12-16 16:34         ` Anton Vorontsov [this message]
2008-12-15  0:12 ` David Gibson

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=20081216163428.GA22756@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=tpiepho@freescale.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.