Re: [PATCH 4.4.y-cip] gpio: rcar: use gpiochip data pointer

Lad Prabhakar

Hi Pavel,

-----Original Message-----
From: Prabhakar Mahadev Lad
Sent: 03 September 2020 19:01
To: Pavel Machek <pavel@...>
Cc: cip-dev@...; Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...>; Biju Das <biju.das.jz@...>
Subject: RE: [PATCH 4.4.y-cip] gpio: rcar: use gpiochip data pointer

Hi Pavel,

Thank you for the review.

-----Original Message-----
From: Pavel Machek <pavel@...>
Sent: 03 September 2020 18:55
To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...>
Cc: cip-dev@...; Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...>; Pavel Machek <pavel@...>; Biju Das
Subject: Re: [PATCH 4.4.y-cip] gpio: rcar: use gpiochip data pointer


This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
Okay, so this is a cleanup that makes sense for mainline.

[PL: Fixes 6e52cced1aa58 ("gpio: rcar: Implement gpiochip.set_multiple()")]
Does it fix set_multiple? ... seems so.

Fixing set_multiple is possible with this oneliner, right?

@@ -541,7 +532,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
irq_chip->irq_release_resources = gpio_rcar_irq_release_resources;

-ret = gpiochip_add(gpio_chip);
+ret = gpiochip_add_data(gpio_chip, p);
if (ret) {
dev_err(dev, "failed to add GPIO controller\n");
goto err0;
The patch is okay and now I understand why you want it. It would have
been nice if changelog told me directly.
My bad.

Can set_multiple use container_of() too? We get less differences
between 4.4 and 4.4-cip that way, and it is still one-liner.
It could use gpio_to_priv(), but since there was an commit upstream already I just pulled it in.
I have now posted a oneliner patch (

Let me know if you if you are OK with the patch or I shall post a one-liner.
Please drop the current patch


Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647

Join { to automatically receive all group messages.