NFC: nfcmrvl: fix firmware-management initialisation
authorJohan Hovold <johan@kernel.org>
Thu, 30 Mar 2017 10:15:39 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:07:56 +0000 (15:07 -0700)
commit06be8e2767da8d2ffeaf490e05cda274935f7f89
tree516b039dae7682d6cde8db58102060ac705d27bb
parent10f03f0f7ef0ee456369b2940e092e0225c754a6
NFC: nfcmrvl: fix firmware-management initialisation

commit 45dd39b974f6632222dd5cdcbea7358a077ab0b0 upstream.

The nci-device was never deregistered in the event that
fw-initialisation failed.

Fix this by moving the firmware initialisation before device
registration since the firmware work queue should be available before
registering.

Note that this depends on a recent fix that moved device-name
initialisation back to to nci_allocate_device() as the
firmware-workqueue name is now derived from the nfc-device name.

Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support")
Cc: Vincent Cuissard <cuissard@marvell.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nfc/nfcmrvl/main.c