Commit 323a98db authored by John W. Linville's avatar John W. Linville

Samuel Ortiz <sameo@linux.intel.com> says:

"Merge tag 'nfc-fixes-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-fixes

This is the first batch of NFC fixes for 3.10, and it contains:

- 3 fixes for the NFC MEI support:
	* We now depend on the correct Kconfig symbol.
	* We register an MEI event callback whenever we enable an NFC device,
	  otherwise we fail to read anything after an enable/disable cycle.
	* We only disable an MEI device from its disable mey_phy_ops,
	  preventing useless consecutive disable calls.

- An NFC Makefile cleanup, as I forgot to remove a commented out line when
  moving the LLCP code to the NFC top level directory."
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parents 6bb4880d e3a6b14c
......@@ -28,7 +28,7 @@ config NFC_WILINK
config NFC_MEI_PHY
tristate "MEI bus NFC device support"
depends on INTEL_MEI_BUS_NFC && NFC_HCI
depends on INTEL_MEI && NFC_HCI
help
This adds support to use an mei bus nfc device. Select this if you
will use an HCI NFC driver for an NFC chip connected behind an
......
......@@ -64,6 +64,15 @@ int nfc_mei_phy_enable(void *phy_id)
return r;
}
r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy);
if (r) {
pr_err("MEY_PHY: Event cb registration failed\n");
mei_cl_disable_device(phy->device);
phy->powered = 0;
return r;
}
phy->powered = 1;
return 0;
......
......@@ -43,24 +43,16 @@ static int microread_mei_probe(struct mei_cl_device *device,
return -ENOMEM;
}
r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy);
if (r) {
pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n");
goto err_out;
}
r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME,
MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD,
&phy->hdev);
if (r < 0)
goto err_out;
return 0;
if (r < 0) {
nfc_mei_phy_free(phy);
err_out:
nfc_mei_phy_free(phy);
return r;
}
return r;
return 0;
}
static int microread_mei_remove(struct mei_cl_device *device)
......@@ -71,8 +63,6 @@ static int microread_mei_remove(struct mei_cl_device *device)
microread_remove(phy->hdev);
nfc_mei_phy_disable(phy);
nfc_mei_phy_free(phy);
return 0;
......
......@@ -43,24 +43,16 @@ static int pn544_mei_probe(struct mei_cl_device *device,
return -ENOMEM;
}
r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy);
if (r) {
pr_err(PN544_DRIVER_NAME ": event cb registration failed\n");
goto err_out;
}
r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME,
MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD,
&phy->hdev);
if (r < 0)
goto err_out;
return 0;
if (r < 0) {
nfc_mei_phy_free(phy);
err_out:
nfc_mei_phy_free(phy);
return r;
}
return r;
return 0;
}
static int pn544_mei_remove(struct mei_cl_device *device)
......@@ -71,8 +63,6 @@ static int pn544_mei_remove(struct mei_cl_device *device)
pn544_hci_remove(phy->hdev);
nfc_mei_phy_disable(phy);
nfc_mei_phy_free(phy);
return 0;
......
......@@ -5,7 +5,6 @@
obj-$(CONFIG_NFC) += nfc.o
obj-$(CONFIG_NFC_NCI) += nci/
obj-$(CONFIG_NFC_HCI) += hci/
#obj-$(CONFIG_NFC_LLCP) += llcp/
nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \
llcp_sock.o
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment