mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Antony N. Pavlov" <antony@niisi.msk.ru>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] gpiolib: import gpio_request_array() from linux 3.7
Date: Fri, 22 Nov 2013 11:49:58 +0400	[thread overview]
Message-ID: <20131122114958.6d6ec0a93ec910d06216b845@niisi.msk.ru> (raw)
In-Reply-To: <20131122072008.GI24559@pengutronix.de>

On Fri, 22 Nov 2013 08:20:08 +0100
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> Hi Antony,
> 
> On Fri, Nov 22, 2013 at 12:11:24AM +0400, Antony Pavlov wrote:
> > Also import related functions gpio_request_one() and
> > gpio_free_array().
> > 
> > This commit imports code from linux 3.7 as
> > the more recent linux kernel versions use gpiolib descriptors,
> > see this commit for details:
> > 
> >   commit 372e722ea4dd4ca11c3d04845e11cbc15f32144c
> >   Author: Alexandre Courbot <acourbot@nvidia.com>
> >   Date:   Sun Feb 3 01:29:29 2013 +0900
> > 
> >       gpiolib: use descriptors internally
> > 
> >       Make sure gpiolib works internally with descriptors and (chip, offset)
> >       pairs instead of using the global integer namespace. This prepares the
> >       ground for the removal of the global gpio_desc[] array and the
> >       introduction of the descriptor-based GPIO API.
> > 
> > Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> 
> What a pitty, we duplicated some work. I created exactly the same patch
> recently but haven't posted it yet, shame on me.

I must say "Thanks!" to Sebastian Hesselbarth. It's him who introduced
get_direction callback. His patch conflicted with patch in my local repo.
So I made the decision to post my patch as soon as possible.


> > +static inline int gpio_request_one(unsigned gpio,
> > +					unsigned long flags, const char *label)
> > +{
> > +	return 0;
> > +}
> > +
> > +static inline int gpio_request_array(const struct gpio *array, size_t num)
> > +{
> > +	return 0;
> > +}
> > +
> 
> That's the only place our patches differ. In my version I return -ENOSYS
> since gpio_request_one() and gpio_request_array() not only request gpios
> but also configure them. We can't return success without configuring the
> gpios. I applied your version but with -ENOSYS here.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
С уважением,
  Павлов Антон

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-11-22  7:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 20:11 [PATCH 1/2] gpio: unify gpio direction macros names with Linux kernel Antony Pavlov
2013-11-21 20:11 ` [PATCH 2/2] gpiolib: import gpio_request_array() from linux 3.7 Antony Pavlov
2013-11-22  7:20   ` Sascha Hauer
2013-11-22  7:49     ` Antony N. Pavlov [this message]
2013-11-22  7:57       ` Sebastian Hesselbarth

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=20131122114958.6d6ec0a93ec910d06216b845@niisi.msk.ru \
    --to=antony@niisi.msk.ru \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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