On Thu, Nov 05, 2015 at 10:44:11AM +0100, Johan Hovold wrote: > On Wed, Nov 04, 2015 at 11:48:47AM +0100, Linus Walleij wrote: > > Thinking about it maybe it's simplest to just make ->dev a pointer > > and kzalloc() it at gpiochip_add(). > > That should solve this. > You'd avoid ever reregistering the same struct device, but that would > not solve the bigger life-time issue by itself. You'd need to do something like have the file reference things via something attached to that device and then ensure that it's made safe (eg, by setting a pointer to NULL and then checking for that on use) when removing the device.
Attachment:
signature.asc
Description: PGP signature