aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorFrederic Danis <frederic.danis@linux.intel.com>2013-05-22 05:36:17 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-13 18:25:53 -0400
commit1095e69f47926db6f1350a9d6a38626521580e87 (patch)
tree0519d46f84f0904f2d8b8c843857645d8b358284 /drivers/nfc
parent4674d0fecbeeb9731274f03ff35a108630be4585 (diff)
NFC: NCI: Fix skb->dev usage
skb->dev is used for carrying a net_device pointer and not an nci_dev pointer. Remove usage of skb-dev to carry nci_dev and replace it by parameter in nci_recv_frame(), nci_send_frame() and driver send() functions. NfcWilink driver is also updated to use those functions. Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/nfcwilink.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c
index 3b731acbc408..41cf8f70a6ad 100644
--- a/drivers/nfc/nfcwilink.c
+++ b/drivers/nfc/nfcwilink.c
@@ -109,7 +109,7 @@ enum {
109 NFCWILINK_FW_DOWNLOAD, 109 NFCWILINK_FW_DOWNLOAD,
110}; 110};
111 111
112static int nfcwilink_send(struct sk_buff *skb); 112static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb);
113 113
114static inline struct sk_buff *nfcwilink_skb_alloc(unsigned int len, gfp_t how) 114static inline struct sk_buff *nfcwilink_skb_alloc(unsigned int len, gfp_t how)
115{ 115{
@@ -156,8 +156,6 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
156 return -ENOMEM; 156 return -ENOMEM;
157 } 157 }
158 158
159 skb->dev = (void *)drv->ndev;
160
161 cmd = (struct nci_vs_nfcc_info_cmd *) 159 cmd = (struct nci_vs_nfcc_info_cmd *)
162 skb_put(skb, sizeof(struct nci_vs_nfcc_info_cmd)); 160 skb_put(skb, sizeof(struct nci_vs_nfcc_info_cmd));
163 cmd->gid = NCI_VS_NFCC_INFO_CMD_GID; 161 cmd->gid = NCI_VS_NFCC_INFO_CMD_GID;
@@ -166,7 +164,7 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
166 164
167 drv->nfcc_info.plen = 0; 165 drv->nfcc_info.plen = 0;
168 166
169 rc = nfcwilink_send(skb); 167 rc = nfcwilink_send(drv->ndev, skb);
170 if (rc) 168 if (rc)
171 return rc; 169 return rc;
172 170
@@ -232,11 +230,9 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
232 return -ENOMEM; 230 return -ENOMEM;
233 } 231 }
234 232
235 skb->dev = (void *)drv->ndev;
236
237 memcpy(skb_put(skb, len), data, len); 233 memcpy(skb_put(skb, len), data, len);
238 234
239 rc = nfcwilink_send(skb); 235 rc = nfcwilink_send(drv->ndev, skb);
240 if (rc) 236 if (rc)
241 return rc; 237 return rc;
242 238
@@ -371,10 +367,8 @@ static long nfcwilink_receive(void *priv_data, struct sk_buff *skb)
371 return 0; 367 return 0;
372 } 368 }
373 369
374 skb->dev = (void *) drv->ndev;
375
376 /* Forward skb to NCI core layer */ 370 /* Forward skb to NCI core layer */
377 rc = nci_recv_frame(skb); 371 rc = nci_recv_frame(drv->ndev, skb);
378 if (rc < 0) { 372 if (rc < 0) {
379 nfc_dev_err(&drv->pdev->dev, "nci_recv_frame failed %d", rc); 373 nfc_dev_err(&drv->pdev->dev, "nci_recv_frame failed %d", rc);
380 return rc; 374 return rc;
@@ -480,9 +474,8 @@ static int nfcwilink_close(struct nci_dev *ndev)
480 return rc; 474 return rc;
481} 475}
482 476
483static int nfcwilink_send(struct sk_buff *skb) 477static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb)
484{ 478{
485 struct nci_dev *ndev = (struct nci_dev *)skb->dev;
486 struct nfcwilink *drv = nci_get_drvdata(ndev); 479 struct nfcwilink *drv = nci_get_drvdata(ndev);
487 struct nfcwilink_hdr hdr = {NFCWILINK_CHNL, NFCWILINK_OPCODE, 0x0000}; 480 struct nfcwilink_hdr hdr = {NFCWILINK_CHNL, NFCWILINK_OPCODE, 0x0000};
488 long len; 481 long len;