aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc/pn533.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-05-31 11:56:46 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-06-04 15:34:34 -0400
commit0201ed0349a71cec12ced7e142e6df78504f38fb (patch)
tree990880344d33e424ccd777fc3635cf6394ad0ff9 /drivers/nfc/pn533.c
parent41a8ec496de8f4ef161fa0293de8cd9aa5773325 (diff)
NFC: Convert pn533 from semaphore to mutex
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/pn533.c')
-rw-r--r--drivers/nfc/pn533.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index b97e3c81ec0b..58c1641cf658 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -329,7 +329,7 @@ struct pn533 {
329 329
330 pn533_cmd_complete_t cmd_complete; 330 pn533_cmd_complete_t cmd_complete;
331 void *cmd_complete_arg; 331 void *cmd_complete_arg;
332 struct semaphore cmd_lock; 332 struct mutex cmd_lock;
333 u8 cmd; 333 u8 cmd;
334 334
335 struct pn533_poll_modulations *poll_mod_active[PN533_POLL_MOD_MAX + 1]; 335 struct pn533_poll_modulations *poll_mod_active[PN533_POLL_MOD_MAX + 1];
@@ -462,7 +462,7 @@ static void pn533_wq_cmd_complete(struct work_struct *work)
462 PN533_FRAME_CMD_PARAMS_LEN(in_frame)); 462 PN533_FRAME_CMD_PARAMS_LEN(in_frame));
463 463
464 if (rc != -EINPROGRESS) 464 if (rc != -EINPROGRESS)
465 up(&dev->cmd_lock); 465 mutex_unlock(&dev->cmd_lock);
466} 466}
467 467
468static void pn533_recv_response(struct urb *urb) 468static void pn533_recv_response(struct urb *urb)
@@ -640,7 +640,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
640 640
641 nfc_dev_dbg(&dev->interface->dev, "%s", __func__); 641 nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
642 642
643 if (down_trylock(&dev->cmd_lock)) 643 if (!mutex_trylock(&dev->cmd_lock))
644 return -EBUSY; 644 return -EBUSY;
645 645
646 rc = __pn533_send_cmd_frame_async(dev, out_frame, in_frame, 646 rc = __pn533_send_cmd_frame_async(dev, out_frame, in_frame,
@@ -650,7 +650,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev,
650 650
651 return 0; 651 return 0;
652error: 652error:
653 up(&dev->cmd_lock); 653 mutex_unlock(&dev->cmd_lock);
654 return rc; 654 return rc;
655} 655}
656 656
@@ -1261,7 +1261,7 @@ static void pn533_listen_mode_timer(unsigned long data)
1261 1261
1262 dev->cancel_listen = 1; 1262 dev->cancel_listen = 1;
1263 1263
1264 up(&dev->cmd_lock); 1264 mutex_unlock(&dev->cmd_lock);
1265 1265
1266 pn533_poll_next_mod(dev); 1266 pn533_poll_next_mod(dev);
1267 1267
@@ -2054,7 +2054,7 @@ error_cmd:
2054 2054
2055 kfree(arg); 2055 kfree(arg);
2056 2056
2057 up(&dev->cmd_lock); 2057 mutex_unlock(&dev->cmd_lock);
2058} 2058}
2059 2059
2060static int pn533_set_configuration(struct pn533 *dev, u8 cfgitem, u8 *cfgdata, 2060static int pn533_set_configuration(struct pn533 *dev, u8 cfgitem, u8 *cfgdata,
@@ -2114,7 +2114,7 @@ static int pn533_probe(struct usb_interface *interface,
2114 2114
2115 dev->udev = usb_get_dev(interface_to_usbdev(interface)); 2115 dev->udev = usb_get_dev(interface_to_usbdev(interface));
2116 dev->interface = interface; 2116 dev->interface = interface;
2117 sema_init(&dev->cmd_lock, 1); 2117 mutex_init(&dev->cmd_lock);
2118 2118
2119 iface_desc = interface->cur_altsetting; 2119 iface_desc = interface->cur_altsetting;
2120 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { 2120 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {