aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorWaldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>2012-12-10 08:42:53 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-01-09 18:51:41 -0500
commit89fb20256725e735601ea6439680956fa2ec4741 (patch)
tree1cc88ff808f892a17b1aaf8481c7cf49d6063e5a /drivers/nfc
parentb08e860355ba6f67b769c9061f468f7a8856bad9 (diff)
NFC: pn533: Remove unused pn533_send_cmd_frame_asy
Remove obsolete send async api as it's no longer used. Remove global dev->in_frame as well, as each packet is kept is a seperate skb struct now, so that's not used anymore. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/pn533.c75
1 files changed, 7 insertions, 68 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 2cb8ceb9be8d..d17ec6a664a0 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -329,7 +329,6 @@ struct pn533 {
329 struct pn533_frame *out_frame; 329 struct pn533_frame *out_frame;
330 330
331 struct urb *in_urb; 331 struct urb *in_urb;
332 struct pn533_frame *in_frame;
333 332
334 struct sk_buff_head resp_q; 333 struct sk_buff_head resp_q;
335 334
@@ -371,13 +370,9 @@ struct pn533 {
371 370
372struct pn533_cmd { 371struct pn533_cmd {
373 struct list_head queue; 372 struct list_head queue;
374 struct pn533_frame *out_frame;
375 struct pn533_frame *in_frame;
376 int in_frame_len;
377 u8 cmd_code; 373 u8 cmd_code;
378 struct sk_buff *req; 374 struct sk_buff *req;
379 struct sk_buff *resp; 375 struct sk_buff *resp;
380 pn533_cmd_complete_t cmd_complete;
381 void *arg; 376 void *arg;
382}; 377};
383 378
@@ -911,69 +906,16 @@ static void pn533_wq_cmd(struct work_struct *work)
911 906
912 mutex_unlock(&dev->cmd_lock); 907 mutex_unlock(&dev->cmd_lock);
913 908
914 if (cmd->cmd_code != PN533_CMD_UNDEF) 909 __pn533_send_cmd_frame_async(dev,
915 __pn533_send_cmd_frame_async(dev, 910 (struct pn533_frame *)cmd->req->data,
916 (struct pn533_frame *)cmd->req->data, 911 (struct pn533_frame *)cmd->resp->data,
917 (struct pn533_frame *)cmd->resp->data, 912 PN533_NORMAL_FRAME_MAX_LEN,
918 PN533_NORMAL_FRAME_MAX_LEN, 913 pn533_send_async_complete,
919 pn533_send_async_complete, 914 cmd->arg);
920 cmd->arg);
921 else
922 __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame,
923 cmd->in_frame_len,
924 cmd->cmd_complete, cmd->arg);
925 915
926 kfree(cmd); 916 kfree(cmd);
927} 917}
928 918
929static int pn533_send_cmd_frame_async(struct pn533 *dev,
930 struct pn533_frame *out_frame,
931 struct pn533_frame *in_frame,
932 int in_frame_len,
933 pn533_cmd_complete_t cmd_complete,
934 void *arg)
935{
936 struct pn533_cmd *cmd;
937 int rc = 0;
938
939 nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
940
941 mutex_lock(&dev->cmd_lock);
942
943 if (!dev->cmd_pending) {
944 rc = __pn533_send_cmd_frame_async(dev, out_frame, in_frame,
945 in_frame_len, cmd_complete,
946 arg);
947 if (!rc)
948 dev->cmd_pending = 1;
949
950 goto unlock;
951 }
952
953 nfc_dev_dbg(&dev->interface->dev, "%s Queueing command", __func__);
954
955 cmd = kzalloc(sizeof(struct pn533_cmd), GFP_KERNEL);
956 if (!cmd) {
957 rc = -ENOMEM;
958 goto unlock;
959 }
960
961 INIT_LIST_HEAD(&cmd->queue);
962 cmd->out_frame = out_frame;
963 cmd->in_frame = in_frame;
964 cmd->in_frame_len = in_frame_len;
965 cmd->cmd_code = PN533_CMD_UNDEF;
966 cmd->cmd_complete = cmd_complete;
967 cmd->arg = arg;
968
969 list_add_tail(&cmd->queue, &dev->cmd_queue);
970
971unlock:
972 mutex_unlock(&dev->cmd_lock);
973
974 return rc;
975}
976
977struct pn533_sync_cmd_response { 919struct pn533_sync_cmd_response {
978 struct sk_buff *resp; 920 struct sk_buff *resp;
979 struct completion done; 921 struct completion done;
@@ -2527,12 +2469,11 @@ static int pn533_probe(struct usb_interface *interface,
2527 goto error; 2469 goto error;
2528 } 2470 }
2529 2471
2530 dev->in_frame = kmalloc(PN533_NORMAL_FRAME_MAX_LEN, GFP_KERNEL);
2531 dev->in_urb = usb_alloc_urb(0, GFP_KERNEL); 2472 dev->in_urb = usb_alloc_urb(0, GFP_KERNEL);
2532 dev->out_frame = kmalloc(PN533_NORMAL_FRAME_MAX_LEN, GFP_KERNEL); 2473 dev->out_frame = kmalloc(PN533_NORMAL_FRAME_MAX_LEN, GFP_KERNEL);
2533 dev->out_urb = usb_alloc_urb(0, GFP_KERNEL); 2474 dev->out_urb = usb_alloc_urb(0, GFP_KERNEL);
2534 2475
2535 if (!dev->in_frame || !dev->out_frame || !dev->in_urb || !dev->out_urb) 2476 if (!dev->out_frame || !dev->in_urb || !dev->out_urb)
2536 goto error; 2477 goto error;
2537 2478
2538 usb_fill_bulk_urb(dev->in_urb, dev->udev, 2479 usb_fill_bulk_urb(dev->in_urb, dev->udev,
@@ -2616,7 +2557,6 @@ free_nfc_dev:
2616destroy_wq: 2557destroy_wq:
2617 destroy_workqueue(dev->wq); 2558 destroy_workqueue(dev->wq);
2618error: 2559error:
2619 kfree(dev->in_frame);
2620 usb_free_urb(dev->in_urb); 2560 usb_free_urb(dev->in_urb);
2621 kfree(dev->out_frame); 2561 kfree(dev->out_frame);
2622 usb_free_urb(dev->out_urb); 2562 usb_free_urb(dev->out_urb);
@@ -2649,7 +2589,6 @@ static void pn533_disconnect(struct usb_interface *interface)
2649 kfree(cmd); 2589 kfree(cmd);
2650 } 2590 }
2651 2591
2652 kfree(dev->in_frame);
2653 usb_free_urb(dev->in_urb); 2592 usb_free_urb(dev->in_urb);
2654 kfree(dev->out_frame); 2593 kfree(dev->out_frame);
2655 usb_free_urb(dev->out_urb); 2594 usb_free_urb(dev->out_urb);