All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Shuah Khan <shuah@kernel.org>,
	Bamvor Jian Zhang <bamv2005@gmail.com>
Subject: Re: [PATCH 1/7] selftests: gpio: rework and simplify test implementation
Date: Mon, 4 Jan 2021 09:51:29 +0800	[thread overview]
Message-ID: <20210104015129.GA4939@sol> (raw)
In-Reply-To: <CAHp75VfONKY7VS0q=GkSX14i--g0=jfBg4RFBoMk4DxJPMHJFg@mail.gmail.com>

On Sun, Jan 03, 2021 at 05:10:10PM +0200, Andy Shevchenko wrote:
> On Sun, Jan 3, 2021 at 4:17 AM Kent Gibson <warthog618@gmail.com> wrote:
> > On Sun, Jan 03, 2021 at 12:20:26AM +0200, Andy Shevchenko wrote:
> > > On Sat, Jan 2, 2021 at 4:32 AM Kent Gibson <warthog618@gmail.com> wrote:
> 
[snip]
> 
> ...
> 
> > > > +       local platform=`cat $SYSFS/kernel/debug/gpio | grep "$chip:" | tr -d ',' | awk '{print $5}'`
> > >
> > > Besides useless use of cat (and tr + awk can be simplified) why are
> >
> > What do you suggest for the tr/awk simplification?
> 
> You have `awk`, you can easily switch the entire pipeline to a little
> awk scriptlet.
> 

Baah, the number that I'm after is in the $SYSFS/kernel/debug/gpio that I
was pulling the platform from, so I can just pull it directly from there.

No need to go hunting through the file system for the base file - the
range of GPIOs assigned to the chip is right there.

In this example it is the 508:

# e.g. gpiochip0: GPIOs 508-511, parent: platform/gpio-mockup.0, gpio-mockup-A:

So I'll use that - unless it is unreliable for some reason?

Cheers,
Kent.


  parent reply	other threads:[~2021-01-04  1:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02  2:29 [PATCH 0/7] selftests: gpio: rework and port to GPIO uAPI v2 Kent Gibson
2021-01-02  2:29 ` [PATCH 1/7] selftests: gpio: rework and simplify test implementation Kent Gibson
     [not found]   ` <CAHp75VdPdRRm+YQ-FzcFV5=XcNL6dXHDROutkgUbPLbj4xa8SQ@mail.gmail.com>
2021-01-02 14:07     ` Kent Gibson
2021-01-02 22:20   ` Andy Shevchenko
2021-01-03  2:17     ` Kent Gibson
2021-01-03 15:10       ` Andy Shevchenko
2021-01-03 16:28         ` Kent Gibson
2021-01-04  1:51         ` Kent Gibson [this message]
2021-01-04 13:52           ` Andy Shevchenko
2021-01-04 15:00             ` Kent Gibson
2021-01-04 15:23               ` Kent Gibson
2021-01-02  2:29 ` [PATCH 2/7] selftests: gpio: remove obsolete gpio-mockup-chardev.c Kent Gibson
2021-01-02  2:29 ` [PATCH 3/7] selftests: remove obsolete build restriction for gpio Kent Gibson
2021-01-02  2:29 ` [PATCH 4/7] selftests: remove obsolete gpio references from kselftest_deps.sh Kent Gibson
2021-01-02  2:29 ` [PATCH 5/7] tools: gpio: remove uAPI v1 code no longer used by selftests Kent Gibson
2021-01-02  2:29 ` [PATCH 6/7] selftests: gpio: port to GPIO uAPI v2 Kent Gibson
2021-01-02  2:29 ` [PATCH 7/7] selftests: gpio: add CONFIG_GPIO_CDEV to config Kent Gibson
2021-01-05 22:31 ` [PATCH 0/7] selftests: gpio: rework and port to GPIO uAPI v2 Linus Walleij

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=20210104015129.GA4939@sol \
    --to=warthog618@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bamv2005@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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.