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


Pavel Machek
 

Hi!

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
container_of().
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;
irq_chip->flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_MASK_ON_SUSPEND;

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

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.

Best regards,

Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Join cip-dev@lists.cip-project.org to automatically receive all group messages.