All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Alexandre Courbot" <gnurou@gmail.com>,
	"Arun Bharadwaj" <arun@gumstix.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Johan Hovold" <johan@kernel.org>,
	chrisrfq@gmail.com,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Sascha Hauer" <kernel@pengutronix.de>
Subject: Re: [PATCH v2 2/3] gpiolib: gpiod_hog remove separate name argument
Date: Thu, 24 Sep 2015 08:39:31 +0200	[thread overview]
Message-ID: <20150924063931.GS32203@pengutronix.de> (raw)
In-Reply-To: <CACRpkdZrXEXtkPpgtrcjqP5jD+M0UOj5Wj69o4zYJQKihsY6Xg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]

Hi,

On Mon, Sep 21, 2015 at 04:28:48PM -0700, Linus Walleij wrote:
> On Sun, Aug 30, 2015 at 12:44 AM, Markus Pargmann <mpa@pengutronix.de> wrote:
> 
> > The gpio name is now stored in the gpio descriptor, so we can simply use
> > that instead of an argument to the function.
> >
> > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> 
> Several problems with this patch:
> 
> - Does not apply to v4.3-rc1

Yes, a bit older already, will rebase it.

> - Fixed that but noted that it just alters the call to gpiod_hog()
>   in of_gpiochip_scan_hogs(), there is a local const char *name that
>   should be removed too.

The local const char *name is temporarily used in
of_gpiochip_scan_hogs() to get the name from DT and assign it to the
descriptor:
	desc = of_parse_own_gpio(np, &name, &lflags, &dflags);
	...
	else
		desc->name = name;

> - Looking at of_get_gpio_hog() it is unclear to me that .name
>   is set in the gpio_desc as desired. Please check this.
> 
>   Crucial code looks like this:
> 
>     if (name && of_property_read_string(np, "line-name", name))
>         *name = np->name;

of_get_gpio_hog() only parses the properties of the DT. It does not
assign any properties to the descriptor itself. So I kept it this way
and added the code for assignment to of_gpiochip_scan_gpios.

> 
>   i.e. is the line-name really propagated to gpiod->name?
>   Are you sure you have tested this with a DTS using line-name
>   and verified that it propagates properly?

Yes this is tested and works for me. I am using the two series together
without problems.

Best Regards,

Markus

-- 
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 |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] gpiolib: gpiod_hog remove separate name argument
Date: Thu, 24 Sep 2015 08:39:31 +0200	[thread overview]
Message-ID: <20150924063931.GS32203@pengutronix.de> (raw)
In-Reply-To: <CACRpkdZrXEXtkPpgtrcjqP5jD+M0UOj5Wj69o4zYJQKihsY6Xg@mail.gmail.com>

Hi,

On Mon, Sep 21, 2015 at 04:28:48PM -0700, Linus Walleij wrote:
> On Sun, Aug 30, 2015 at 12:44 AM, Markus Pargmann <mpa@pengutronix.de> wrote:
> 
> > The gpio name is now stored in the gpio descriptor, so we can simply use
> > that instead of an argument to the function.
> >
> > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> 
> Several problems with this patch:
> 
> - Does not apply to v4.3-rc1

Yes, a bit older already, will rebase it.

> - Fixed that but noted that it just alters the call to gpiod_hog()
>   in of_gpiochip_scan_hogs(), there is a local const char *name that
>   should be removed too.

The local const char *name is temporarily used in
of_gpiochip_scan_hogs() to get the name from DT and assign it to the
descriptor:
	desc = of_parse_own_gpio(np, &name, &lflags, &dflags);
	...
	else
		desc->name = name;

> - Looking at of_get_gpio_hog() it is unclear to me that .name
>   is set in the gpio_desc as desired. Please check this.
> 
>   Crucial code looks like this:
> 
>     if (name && of_property_read_string(np, "line-name", name))
>         *name = np->name;

of_get_gpio_hog() only parses the properties of the DT. It does not
assign any properties to the descriptor itself. So I kept it this way
and added the code for assignment to of_gpiochip_scan_gpios.

> 
>   i.e. is the line-name really propagated to gpiod->name?
>   Are you sure you have tested this with a DTS using line-name
>   and verified that it propagates properly?

Yes this is tested and works for me. I am using the two series together
without problems.

Best Regards,

Markus

-- 
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 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150924/4293446e/attachment.sig>

  reply	other threads:[~2015-09-24  6:39 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-30  7:44 [PATCH v2 0/3] gpiolib: Initializing GPIOs using DT property gpio-initval Markus Pargmann
2015-08-30  7:44 ` Markus Pargmann
2015-08-30  7:44 ` [PATCH v2 1/3] gpio: Use __gpiod_request directly Markus Pargmann
2015-08-30  7:44   ` Markus Pargmann
2015-09-21 21:41   ` Linus Walleij
2015-09-21 21:41     ` Linus Walleij
2015-09-23  4:25   ` Alexandre Courbot
2015-09-23  4:25     ` Alexandre Courbot
     [not found]     ` <CAAVeFuJPzjJ6td9UZ993sbfOyEOo=7WVu-Y2KnFgXewyt_8knA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-24  7:02       ` Markus Pargmann
2015-09-24  7:02         ` Markus Pargmann
2015-09-24 17:49       ` Linus Walleij
2015-09-24 17:49         ` Linus Walleij
     [not found]         ` <CACRpkdaBxAhWKnJ3vsd+K6xMgaym7D9M0zTEMu_=fmiUNpxTEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-27 14:32           ` Markus Pargmann
2015-09-27 14:32             ` Markus Pargmann
     [not found] ` <1440920686-6892-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-08-30  7:44   ` [PATCH v2 2/3] gpiolib: gpiod_hog remove separate name argument Markus Pargmann
2015-08-30  7:44     ` Markus Pargmann
2015-09-21 23:28     ` Linus Walleij
2015-09-21 23:28       ` Linus Walleij
2015-09-24  6:39       ` Markus Pargmann [this message]
2015-09-24  6:39         ` Markus Pargmann
2015-09-24 17:52         ` Linus Walleij
2015-09-24 17:52           ` Linus Walleij
2015-09-27 14:34           ` Markus Pargmann
2015-09-27 14:34             ` Markus Pargmann
2015-08-30  7:44 ` [PATCH v2 3/3] gpiolib: Add GPIO initialization Markus Pargmann
2015-08-30  7:44   ` Markus Pargmann
2015-09-21 11:01   ` Markus Pargmann
2015-09-21 11:01     ` Markus Pargmann
2015-09-21 23:42   ` Linus Walleij
2015-09-21 23:42     ` Linus Walleij
2015-09-24  6:48     ` Markus Pargmann
2015-09-24  6:48       ` Markus Pargmann
2017-02-07 11:09   ` Uwe Kleine-König
2017-02-07 11:09     ` Uwe Kleine-König
2017-02-07 13:30     ` Lothar Waßmann
2017-02-07 13:30       ` Lothar Waßmann
2017-02-07 14:57       ` Uwe Kleine-König
2017-02-07 14:57         ` Uwe Kleine-König
     [not found]     ` <20170207110950.zy5pzo2hq6hrvmr5-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-05-06 20:32       ` Uwe Kleine-König
2017-05-06 20:32         ` Uwe Kleine-König
2017-05-07  7:30         ` Linus Walleij
2017-05-07  7:30           ` Linus Walleij
2017-05-07  9:45           ` Uwe Kleine-König
2017-05-07  9:45             ` Uwe Kleine-König
2017-05-11 14:29             ` Linus Walleij
2017-05-11 14:29               ` Linus Walleij
     [not found]               ` <CACRpkdZPwH3vPjdCgCjYW4Q5OvbE5O0RLJ4bV-QLR2nVLy4kAQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-11 20:18                 ` Uwe Kleine-König
2017-05-11 20:18                   ` Uwe Kleine-König
2017-05-07 10:22     ` Russell King - ARM Linux
2017-05-07 10:22       ` Russell King - ARM Linux
2017-05-07 12:38       ` Uwe Kleine-König
2017-05-07 12:38         ` Uwe Kleine-König

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=20150924063931.GS32203@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=arun@gumstix.com \
    --cc=chrisrfq@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gnurou@gmail.com \
    --cc=johan@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=u.kleine-koenig@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 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.