Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: John W. Linville <linville@tuxdriver.com>

+20 -32
+1 -1
drivers/nfc/Kconfig
··· 28 28 29 29 config NFC_MEI_PHY 30 30 tristate "MEI bus NFC device support" 31 - depends on INTEL_MEI_BUS_NFC && NFC_HCI 31 + depends on INTEL_MEI && NFC_HCI 32 32 help 33 33 This adds support to use an mei bus nfc device. Select this if you 34 34 will use an HCI NFC driver for an NFC chip connected behind an
+9
drivers/nfc/mei_phy.c
··· 64 64 return r; 65 65 } 66 66 67 + r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy); 68 + if (r) { 69 + pr_err("MEY_PHY: Event cb registration failed\n"); 70 + mei_cl_disable_device(phy->device); 71 + phy->powered = 0; 72 + 73 + return r; 74 + } 75 + 67 76 phy->powered = 1; 68 77 69 78 return 0;
+5 -15
drivers/nfc/microread/mei.c
··· 43 43 return -ENOMEM; 44 44 } 45 45 46 - r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); 47 - if (r) { 48 - pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n"); 49 - goto err_out; 50 - } 51 - 52 46 r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 53 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 54 48 &phy->hdev); 55 - if (r < 0) 56 - goto err_out; 49 + if (r < 0) { 50 + nfc_mei_phy_free(phy); 51 + 52 + return r; 53 + } 57 54 58 55 return 0; 59 - 60 - err_out: 61 - nfc_mei_phy_free(phy); 62 - 63 - return r; 64 56 } 65 57 66 58 static int microread_mei_remove(struct mei_cl_device *device) ··· 62 70 pr_info("Removing microread\n"); 63 71 64 72 microread_remove(phy->hdev); 65 - 66 - nfc_mei_phy_disable(phy); 67 73 68 74 nfc_mei_phy_free(phy); 69 75
+5 -15
drivers/nfc/pn544/mei.c
··· 43 43 return -ENOMEM; 44 44 } 45 45 46 - r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); 47 - if (r) { 48 - pr_err(PN544_DRIVER_NAME ": event cb registration failed\n"); 49 - goto err_out; 50 - } 51 - 52 46 r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME, 53 47 MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, 54 48 &phy->hdev); 55 - if (r < 0) 56 - goto err_out; 49 + if (r < 0) { 50 + nfc_mei_phy_free(phy); 51 + 52 + return r; 53 + } 57 54 58 55 return 0; 59 - 60 - err_out: 61 - nfc_mei_phy_free(phy); 62 - 63 - return r; 64 56 } 65 57 66 58 static int pn544_mei_remove(struct mei_cl_device *device) ··· 62 70 pr_info("Removing pn544\n"); 63 71 64 72 pn544_hci_remove(phy->hdev); 65 - 66 - nfc_mei_phy_disable(phy); 67 73 68 74 nfc_mei_phy_free(phy); 69 75
-1
net/nfc/Makefile
··· 5 5 obj-$(CONFIG_NFC) += nfc.o 6 6 obj-$(CONFIG_NFC_NCI) += nci/ 7 7 obj-$(CONFIG_NFC_HCI) += hci/ 8 - #obj-$(CONFIG_NFC_LLCP) += llcp/ 9 8 10 9 nfc-objs := core.o netlink.o af_nfc.o rawsock.o llcp_core.o llcp_commands.o \ 11 10 llcp_sock.o