NFC: st-nci: Fix st_nci_gates offset
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 25 Oct 2015 21:54:34 +0000 (22:54 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 26 Oct 2015 05:53:17 +0000 (06:53 +0100)
It is useless to start from index 0 when looking for a gate
because only dynamic pipes are retrieved with
ST_NCI_DM_GETINFO(ST_NCI_DM_GETINFO_PIPE_LIST).

The first dynamic pipe is present at index 3.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st-nci/se.c

index 5d1747d2142138b9d03ae71077028cb1eb6f5552..4c98346bab04db25583d42db96b052d7d9f4278e 100644 (file)
@@ -228,7 +228,7 @@ int st_nci_hci_load_session(struct nci_dev *ndev)
                        continue;
                }
 
-               for (j = 0; (j < ARRAY_SIZE(st_nci_gates)) &&
+               for (j = 3; (j < ARRAY_SIZE(st_nci_gates)) &&
                     (st_nci_gates[j].gate != dm_pipe_info->dst_gate_id); j++)
                        ;