Messages in this thread | | | From | Linus Walleij <> | Date | Sat, 16 May 2020 11:50:45 +0200 | Subject | Re: [PATCH 2/3] gpiolib: use kref in gpio_desc |
| |
On Thu, May 14, 2020 at 3:42 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> So this "numbing down" of the chip works - in that I don't see any > splat in the above use-case but right now if nvmem takes an existing > GPIO descriptor over nvmem_config, then it will call gpiod_put() on it > and we'll do the same in the provider driver leading to the following > warning:
Isn't that the WARN_ON(extra_checks) in gpiod_free()? What part of the if() clause is causing this? I.e.: if (desc && desc->gdev && gpiod_free_commit(desc)) ...
I suspect gpiod_free_commit() is causing it by returning nonzero. We could essentially ignore that if and only if the gpio_chip has been detached from the gpio_device.
This should fix the problem if I'm right.
Yours, Linus Walleij
| |