aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorWaldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>2012-11-26 08:18:33 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-01-09 18:44:27 -0500
commitd94ea4f54516b32affeda7ef097b93bca6e6fd32 (patch)
tree41a23dd7537d3516fe8bec2d49d273b0839ce0b0 /drivers/nfc
parentb1bb290ac2308616b24c5986665d7199ff7b9df3 (diff)
NFC: pn533: Remove pointless flags param
__pn533_send_cmd_frame_async() is called when lock is held so GFP_KERNEL flag will be always used. Thus, having extra param does not optimise the code. 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.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 7040106cb7f2..5f3459d11e73 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -392,7 +392,6 @@ struct pn533_cmd {
392 int in_frame_len; 392 int in_frame_len;
393 pn533_cmd_complete_t cmd_complete; 393 pn533_cmd_complete_t cmd_complete;
394 void *arg; 394 void *arg;
395 gfp_t flags;
396}; 395};
397 396
398struct pn533_frame { 397struct pn533_frame {
@@ -646,7 +645,7 @@ static int __pn533_send_cmd_frame_async(struct pn533 *dev,
646 struct pn533_frame *in_frame, 645 struct pn533_frame *in_frame,
647 int in_frame_len, 646 int in_frame_len,
648 pn533_cmd_complete_t cmd_complete, 647 pn533_cmd_complete_t cmd_complete,
649 void *arg, gfp_t flags) 648 void *arg)
650{ 649{
651 int rc; 650 int rc;
652 651
@@ -664,11 +663,11 @@ static int __pn533_send_cmd_frame_async(struct pn533 *dev,
664 dev->in_urb->transfer_buffer = in_frame; 663 dev->in_urb->transfer_buffer = in_frame;
665 dev->in_urb->transfer_buffer_length = in_frame_len; 664 dev->in_urb->transfer_buffer_length = in_frame_len;
666 665
667 rc = usb_submit_urb(dev->out_urb, flags); 666 rc = usb_submit_urb(dev->out_urb, GFP_KERNEL);
668 if (rc) 667 if (rc)
669 return rc; 668 return rc;
670 669
671 rc = pn533_submit_urb_for_ack(dev, flags); 670 rc = pn533_submit_urb_for_ack(dev, GFP_KERNEL);
672 if (rc) 671 if (rc)
673 goto error; 672 goto error;
674 673
@@ -700,7 +699,7 @@ static void pn533_wq_cmd(struct work_struct *work)
700 699
701 __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame, 700 __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame,
702 cmd->in_frame_len, cmd->cmd_complete, 701 cmd->in_frame_len, cmd->cmd_complete,
703 cmd->arg, cmd->flags); 702 cmd->arg);
704 703
705 kfree(cmd); 704 kfree(cmd);
706} 705}
@@ -710,7 +709,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
710 struct pn533_frame *in_frame, 709 struct pn533_frame *in_frame,
711 int in_frame_len, 710 int in_frame_len,
712 pn533_cmd_complete_t cmd_complete, 711 pn533_cmd_complete_t cmd_complete,
713 void *arg, gfp_t flags) 712 void *arg)
714{ 713{
715 struct pn533_cmd *cmd; 714 struct pn533_cmd *cmd;
716 int rc = 0; 715 int rc = 0;
@@ -722,7 +721,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
722 if (!dev->cmd_pending) { 721 if (!dev->cmd_pending) {
723 rc = __pn533_send_cmd_frame_async(dev, out_frame, in_frame, 722 rc = __pn533_send_cmd_frame_async(dev, out_frame, in_frame,
724 in_frame_len, cmd_complete, 723 in_frame_len, cmd_complete,
725 arg, flags); 724 arg);
726 if (!rc) 725 if (!rc)
727 dev->cmd_pending = 1; 726 dev->cmd_pending = 1;
728 727
@@ -731,7 +730,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
731 730
732 nfc_dev_dbg(&dev->interface->dev, "%s Queueing command", __func__); 731 nfc_dev_dbg(&dev->interface->dev, "%s Queueing command", __func__);
733 732
734 cmd = kzalloc(sizeof(struct pn533_cmd), flags); 733 cmd = kzalloc(sizeof(struct pn533_cmd), GFP_KERNEL);
735 if (!cmd) { 734 if (!cmd) {
736 rc = -ENOMEM; 735 rc = -ENOMEM;
737 goto unlock; 736 goto unlock;
@@ -743,7 +742,6 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
743 cmd->in_frame_len = in_frame_len; 742 cmd->in_frame_len = in_frame_len;
744 cmd->cmd_complete = cmd_complete; 743 cmd->cmd_complete = cmd_complete;
745 cmd->arg = arg; 744 cmd->arg = arg;
746 cmd->flags = flags;
747 745
748 list_add_tail(&cmd->queue, &dev->cmd_queue); 746 list_add_tail(&cmd->queue, &dev->cmd_queue);
749 747
@@ -788,7 +786,7 @@ static int pn533_send_cmd_frame_sync(struct pn533 *dev,
788 init_completion(&arg.done); 786 init_completion(&arg.done);
789 787
790 rc = pn533_send_cmd_frame_async(dev, out_frame, in_frame, in_frame_len, 788 rc = pn533_send_cmd_frame_async(dev, out_frame, in_frame, in_frame_len,
791 pn533_sync_cmd_complete, &arg, GFP_KERNEL); 789 pn533_sync_cmd_complete, &arg);
792 if (rc) 790 if (rc)
793 return rc; 791 return rc;
794 792
@@ -1296,7 +1294,7 @@ static void pn533_wq_tg_get_data(struct work_struct *work)
1296 pn533_send_cmd_frame_async(dev, dev->out_frame, in_frame, 1294 pn533_send_cmd_frame_async(dev, dev->out_frame, in_frame,
1297 skb_resp_len, 1295 skb_resp_len,
1298 pn533_tm_get_data_complete, 1296 pn533_tm_get_data_complete,
1299 skb_resp, GFP_KERNEL); 1297 skb_resp);
1300 1298
1301 return; 1299 return;
1302} 1300}
@@ -1450,7 +1448,7 @@ static int pn533_send_poll_frame(struct pn533 *dev)
1450 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, 1448 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
1451 PN533_NORMAL_FRAME_MAX_LEN, 1449 PN533_NORMAL_FRAME_MAX_LEN,
1452 pn533_poll_complete, 1450 pn533_poll_complete,
1453 NULL, GFP_KERNEL); 1451 NULL);
1454 if (rc) 1452 if (rc)
1455 nfc_dev_err(&dev->interface->dev, "Polling loop error %d", rc); 1453 nfc_dev_err(&dev->interface->dev, "Polling loop error %d", rc);
1456 1454
@@ -1818,8 +1816,7 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
1818 1816
1819 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, 1817 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
1820 PN533_NORMAL_FRAME_MAX_LEN, 1818 PN533_NORMAL_FRAME_MAX_LEN,
1821 pn533_in_dep_link_up_complete, cmd, 1819 pn533_in_dep_link_up_complete, cmd);
1822 GFP_KERNEL);
1823 if (rc < 0) 1820 if (rc < 0)
1824 kfree(cmd); 1821 kfree(cmd);
1825 1822
@@ -2056,8 +2053,7 @@ static int pn533_transceive(struct nfc_dev *nfc_dev,
2056 arg->cb_context = cb_context; 2053 arg->cb_context = cb_context;
2057 2054
2058 rc = pn533_send_cmd_frame_async(dev, out_frame, in_frame, skb_resp_len, 2055 rc = pn533_send_cmd_frame_async(dev, out_frame, in_frame, skb_resp_len,
2059 pn533_data_exchange_complete, arg, 2056 pn533_data_exchange_complete, arg);
2060 GFP_KERNEL);
2061 if (rc) { 2057 if (rc) {
2062 nfc_dev_err(&dev->interface->dev, "Error %d when trying to" 2058 nfc_dev_err(&dev->interface->dev, "Error %d when trying to"
2063 " perform data_exchange", rc); 2059 " perform data_exchange", rc);
@@ -2121,8 +2117,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
2121 2117
2122 rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame, 2118 rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame,
2123 PN533_NORMAL_FRAME_MAX_LEN, 2119 PN533_NORMAL_FRAME_MAX_LEN,
2124 pn533_tm_send_complete, skb, 2120 pn533_tm_send_complete, skb);
2125 GFP_KERNEL);
2126 if (rc) { 2121 if (rc) {
2127 nfc_dev_err(&dev->interface->dev, 2122 nfc_dev_err(&dev->interface->dev,
2128 "Error %d when trying to send data", rc); 2123 "Error %d when trying to send data", rc);
@@ -2184,7 +2179,7 @@ static void pn533_wq_mi_recv(struct work_struct *work)
2184 rc = __pn533_send_cmd_frame_async(dev, out_frame, in_frame, 2179 rc = __pn533_send_cmd_frame_async(dev, out_frame, in_frame,
2185 skb_resp_len, 2180 skb_resp_len,
2186 pn533_data_exchange_complete, 2181 pn533_data_exchange_complete,
2187 dev->cmd_complete_arg, GFP_KERNEL); 2182 dev->cmd_complete_arg);
2188 if (!rc) 2183 if (!rc)
2189 return; 2184 return;
2190 2185