Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-18 Thread Linus Walleij
On Tue, Dec 15, 2015 at 8:25 AM, Dmitry Torokhov wrote: > On Mon, Dec 14, 2015 at 1:18 AM, Linus Walleij > wrote: >> At this point we have to cross-reference the pointer to my chip to >> find the chip to remove. This goes for anything that takes the struct >> gpio_chip * >> as parameter, like g

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-18 Thread Linus Walleij
On Mon, Dec 14, 2015 at 1:46 PM, Johan Hovold wrote: > Ok, but let's take a step back. So you have all this in place and a > consumer calls gpiod_get_value() that returns an errno because the device > is gone. Note that this wasn't even possible before e20538b82f1f ("gpio: > Propagate errors from

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-14 Thread Dmitry Torokhov
On Mon, Dec 14, 2015 at 1:18 AM, Linus Walleij wrote: > On Wed, Dec 9, 2015 at 8:30 PM, Dmitry Torokhov > wrote: >> On Wed, Dec 09, 2015 at 02:08:35PM +0100, Linus Walleij wrote: >>> This removes the use of container_of() constructions from *all* >>> GPIO drivers in the kernel. It is done by inst

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-14 Thread Johan Hovold
On Wed, Dec 09, 2015 at 03:46:00PM +0100, Linus Walleij wrote: > On Wed, Dec 9, 2015 at 2:44 PM, Russell King - ARM Linux > wrote: > > On Wed, Dec 09, 2015 at 02:08:35PM +0100, Linus Walleij wrote: > >> Because we want to have a proper userspace ABI for GPIO chips, > >> which involves using a cha

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-14 Thread Linus Walleij
On Wed, Dec 9, 2015 at 8:30 PM, Dmitry Torokhov wrote: > On Wed, Dec 09, 2015 at 02:08:35PM +0100, Linus Walleij wrote: >> This removes the use of container_of() constructions from *all* >> GPIO drivers in the kernel. It is done by instead adding an >> optional void *data pointer to the struct gpi

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-09 Thread Dmitry Torokhov
On Wed, Dec 09, 2015 at 02:08:35PM +0100, Linus Walleij wrote: > This removes the use of container_of() constructions from *all* > GPIO drivers in the kernel. It is done by instead adding an > optional void *data pointer to the struct gpio_chip and an > accessor function, gpiochip_get_data() to get

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-09 Thread Linus Walleij
On Wed, Dec 9, 2015 at 2:44 PM, Russell King - ARM Linux wrote: Thanks Russell, I think you speed up the design and shorten the development time by providing these ideas, so it is much, much appreciated. > On Wed, Dec 09, 2015 at 02:08:35PM +0100, Linus Walleij wrote: >> Because we want to have

Re: [PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-09 Thread Russell King - ARM Linux
On Wed, Dec 09, 2015 at 02:08:35PM +0100, Linus Walleij wrote: > Because we want to have a proper userspace ABI for GPIO chips, > which involves using a character device that the user opens > and closes. While the character device is open, the underlying > kernel objects must not go away. Okay, so

[PATCH 000/182] Rid struct gpio_chip from container_of() usage

2015-12-09 Thread Linus Walleij
This removes the use of container_of() constructions from *all* GPIO drivers in the kernel. It is done by instead adding an optional void *data pointer to the struct gpio_chip and an accessor function, gpiochip_get_data() to get it from a driver. WHY? Because we want to have a proper userspace AB