linux/drivers/nfc/pn533
Lars Poeschel 843cc92ed3 nfc: pn533: Split pn533 init & nfc_register
There is a problem in the initialisation and setup of the pn533: It
registers with nfc too early. It could happen, that it finished
registering with nfc and someone starts using it. But setup of the pn533
is not yet finished. Bad or at least unintended things could happen.
So I split out nfc registering (and unregistering) to seperate functions
that have to be called late in probe then.
i2c requires a bit more love: i2c requests an irq in it's probe
function. 'Commit 32ecc75ded ("NFC: pn533: change order operations in
dev registation")' shows, this can not happen too early. An irq can be
served before structs are fully initialized. The way chosen to prevent
this is to request the irq after nfc_alloc_device initialized the
structs, but before nfc_register_device. So there is now this
pn532_i2c_nfc_alloc function.

Cc: Johan Hovold <johan@kernel.org>
Cc: Claudiu Beznea <Claudiu.Beznea@microchip.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-10-29 21:05:26 -07:00
..
i2c.c nfc: pn533: Split pn533 init & nfc_register 2019-10-29 21:05:26 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
pn533.c nfc: pn533: Split pn533 init & nfc_register 2019-10-29 21:05:26 -07:00
pn533.h nfc: pn533: Split pn533 init & nfc_register 2019-10-29 21:05:26 -07:00
usb.c nfc: pn533: Split pn533 init & nfc_register 2019-10-29 21:05:26 -07:00