aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-04-07 03:17:00 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2015-04-07 06:05:12 -0400
commit3590ebc040c9ee5d06754ce926f0e7c3a595e46d (patch)
tree62d4e1160321ab1d8172e780280232311e4cd5e3 /drivers/nfc
parent5df848f37b1d20e5dd64bea16ba9f69ed321e11b (diff)
NFC: logging neatening
Add missing terminating newlines to nfc_info and nfc_err to avoid possible interleaving from other messages. Miscellanea: o typo fix of "unknonwn" in message o remove unnecessary OOM messages as there's a generic dump_stack() o realign arguments Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/microread/i2c.c2
-rw-r--r--drivers/nfc/nfcmrvl/main.c4
-rw-r--r--drivers/nfc/nfcmrvl/usb.c18
-rw-r--r--drivers/nfc/pn533.c2
-rw-r--r--drivers/nfc/pn544/i2c.c7
-rw-r--r--drivers/nfc/port100.c36
-rw-r--r--drivers/nfc/st21nfcb/i2c.c5
-rw-r--r--drivers/nfc/st21nfcb/ndlc.c5
8 files changed, 36 insertions, 43 deletions
diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c
index df85cd3d9db0..661e2c8143c4 100644
--- a/drivers/nfc/microread/i2c.c
+++ b/drivers/nfc/microread/i2c.c
@@ -286,7 +286,7 @@ static int microread_i2c_probe(struct i2c_client *client,
286 if (r < 0) 286 if (r < 0)
287 goto err_irq; 287 goto err_irq;
288 288
289 nfc_info(&client->dev, "Probed"); 289 nfc_info(&client->dev, "Probed\n");
290 290
291 return 0; 291 return 0;
292 292
diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c
index 85e8bcf98693..ad4933cefbd1 100644
--- a/drivers/nfc/nfcmrvl/main.c
+++ b/drivers/nfc/nfcmrvl/main.c
@@ -111,7 +111,7 @@ struct nfcmrvl_private *nfcmrvl_nci_register_dev(void *drv_data,
111 111
112 priv->ndev = nci_allocate_device(&nfcmrvl_nci_ops, protocols, 0, 0); 112 priv->ndev = nci_allocate_device(&nfcmrvl_nci_ops, protocols, 0, 0);
113 if (!priv->ndev) { 113 if (!priv->ndev) {
114 nfc_err(dev, "nci_allocate_device failed"); 114 nfc_err(dev, "nci_allocate_device failed\n");
115 rc = -ENOMEM; 115 rc = -ENOMEM;
116 goto error; 116 goto error;
117 } 117 }
@@ -120,7 +120,7 @@ struct nfcmrvl_private *nfcmrvl_nci_register_dev(void *drv_data,
120 120
121 rc = nci_register_device(priv->ndev); 121 rc = nci_register_device(priv->ndev);
122 if (rc) { 122 if (rc) {
123 nfc_err(dev, "nci_register_device failed %d", rc); 123 nfc_err(dev, "nci_register_device failed %d\n", rc);
124 nci_free_device(priv->ndev); 124 nci_free_device(priv->ndev);
125 goto error; 125 goto error;
126 } 126 }
diff --git a/drivers/nfc/nfcmrvl/usb.c b/drivers/nfc/nfcmrvl/usb.c
index 3221ca37d6c9..6cf15c1a2618 100644
--- a/drivers/nfc/nfcmrvl/usb.c
+++ b/drivers/nfc/nfcmrvl/usb.c
@@ -80,7 +80,7 @@ static void nfcmrvl_bulk_complete(struct urb *urb)
80 if (!urb->status) { 80 if (!urb->status) {
81 if (nfcmrvl_nci_recv_frame(drv_data->priv, urb->transfer_buffer, 81 if (nfcmrvl_nci_recv_frame(drv_data->priv, urb->transfer_buffer,
82 urb->actual_length) < 0) 82 urb->actual_length) < 0)
83 nfc_err(&drv_data->udev->dev, "corrupted Rx packet"); 83 nfc_err(&drv_data->udev->dev, "corrupted Rx packet\n");
84 } 84 }
85 85
86 if (!test_bit(NFCMRVL_USB_BULK_RUNNING, &drv_data->flags)) 86 if (!test_bit(NFCMRVL_USB_BULK_RUNNING, &drv_data->flags))
@@ -96,7 +96,7 @@ static void nfcmrvl_bulk_complete(struct urb *urb)
96 */ 96 */
97 if (err != -EPERM && err != -ENODEV) 97 if (err != -EPERM && err != -ENODEV)
98 nfc_err(&drv_data->udev->dev, 98 nfc_err(&drv_data->udev->dev,
99 "urb %p failed to resubmit (%d)", urb, -err); 99 "urb %p failed to resubmit (%d)\n", urb, -err);
100 usb_unanchor_urb(urb); 100 usb_unanchor_urb(urb);
101 } 101 }
102} 102}
@@ -137,7 +137,7 @@ nfcmrvl_submit_bulk_urb(struct nfcmrvl_usb_drv_data *drv_data, gfp_t mem_flags)
137 if (err) { 137 if (err) {
138 if (err != -EPERM && err != -ENODEV) 138 if (err != -EPERM && err != -ENODEV)
139 nfc_err(&drv_data->udev->dev, 139 nfc_err(&drv_data->udev->dev,
140 "urb %p submission failed (%d)", urb, -err); 140 "urb %p submission failed (%d)\n", urb, -err);
141 usb_unanchor_urb(urb); 141 usb_unanchor_urb(urb);
142 } 142 }
143 143
@@ -153,7 +153,7 @@ static void nfcmrvl_tx_complete(struct urb *urb)
153 struct nfcmrvl_private *priv = nci_get_drvdata(ndev); 153 struct nfcmrvl_private *priv = nci_get_drvdata(ndev);
154 struct nfcmrvl_usb_drv_data *drv_data = priv->drv_data; 154 struct nfcmrvl_usb_drv_data *drv_data = priv->drv_data;
155 155
156 nfc_info(priv->dev, "urb %p status %d count %d", 156 nfc_info(priv->dev, "urb %p status %d count %d\n",
157 urb, urb->status, urb->actual_length); 157 urb, urb->status, urb->actual_length);
158 158
159 spin_lock(&drv_data->txlock); 159 spin_lock(&drv_data->txlock);
@@ -253,7 +253,7 @@ static int nfcmrvl_usb_nci_send(struct nfcmrvl_private *priv,
253 if (err) { 253 if (err) {
254 if (err != -EPERM && err != -ENODEV) 254 if (err != -EPERM && err != -ENODEV)
255 nfc_err(&drv_data->udev->dev, 255 nfc_err(&drv_data->udev->dev,
256 "urb %p submission failed (%d)", urb, -err); 256 "urb %p submission failed (%d)\n", urb, -err);
257 kfree(urb->setup_packet); 257 kfree(urb->setup_packet);
258 usb_unanchor_urb(urb); 258 usb_unanchor_urb(urb);
259 } else { 259 } else {
@@ -293,7 +293,7 @@ static int nfcmrvl_probe(struct usb_interface *intf,
293 int i; 293 int i;
294 struct usb_device *udev = interface_to_usbdev(intf); 294 struct usb_device *udev = interface_to_usbdev(intf);
295 295
296 nfc_info(&udev->dev, "intf %p id %p", intf, id); 296 nfc_info(&udev->dev, "intf %p id %p\n", intf, id);
297 297
298 drv_data = devm_kzalloc(&intf->dev, sizeof(*drv_data), GFP_KERNEL); 298 drv_data = devm_kzalloc(&intf->dev, sizeof(*drv_data), GFP_KERNEL);
299 if (!drv_data) 299 if (!drv_data)
@@ -348,7 +348,7 @@ static void nfcmrvl_disconnect(struct usb_interface *intf)
348 if (!drv_data) 348 if (!drv_data)
349 return; 349 return;
350 350
351 nfc_info(&drv_data->udev->dev, "intf %p", intf); 351 nfc_info(&drv_data->udev->dev, "intf %p\n", intf);
352 352
353 nfcmrvl_nci_unregister_dev(drv_data->priv); 353 nfcmrvl_nci_unregister_dev(drv_data->priv);
354 354
@@ -360,7 +360,7 @@ static int nfcmrvl_suspend(struct usb_interface *intf, pm_message_t message)
360{ 360{
361 struct nfcmrvl_usb_drv_data *drv_data = usb_get_intfdata(intf); 361 struct nfcmrvl_usb_drv_data *drv_data = usb_get_intfdata(intf);
362 362
363 nfc_info(&drv_data->udev->dev, "intf %p", intf); 363 nfc_info(&drv_data->udev->dev, "intf %p\n", intf);
364 364
365 if (drv_data->suspend_count++) 365 if (drv_data->suspend_count++)
366 return 0; 366 return 0;
@@ -401,7 +401,7 @@ static int nfcmrvl_resume(struct usb_interface *intf)
401 struct nfcmrvl_usb_drv_data *drv_data = usb_get_intfdata(intf); 401 struct nfcmrvl_usb_drv_data *drv_data = usb_get_intfdata(intf);
402 int err = 0; 402 int err = 0;
403 403
404 nfc_info(&drv_data->udev->dev, "intf %p", intf); 404 nfc_info(&drv_data->udev->dev, "intf %p\n", intf);
405 405
406 if (--drv_data->suspend_count) 406 if (--drv_data->suspend_count)
407 return 0; 407 return 0;
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 732e6075da62..a03e4eb5fe29 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -1820,7 +1820,7 @@ static int pn533_rf_complete(struct pn533 *dev, void *arg,
1820 if (IS_ERR(resp)) { 1820 if (IS_ERR(resp)) {
1821 rc = PTR_ERR(resp); 1821 rc = PTR_ERR(resp);
1822 1822
1823 nfc_err(&dev->interface->dev, "RF setting error %d", rc); 1823 nfc_err(&dev->interface->dev, "RF setting error %d\n", rc);
1824 1824
1825 return rc; 1825 return rc;
1826 } 1826 }
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index cdde745b96bd..6fd986f5ac3e 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -953,7 +953,7 @@ static int pn544_hci_i2c_acpi_request_resources(struct i2c_client *client)
953 } 953 }
954 954
955 nfc_info(dev, "GPIO resource, no:%d irq:%d\n", 955 nfc_info(dev, "GPIO resource, no:%d irq:%d\n",
956 desc_to_gpio(gpiod_irq), ret); 956 desc_to_gpio(gpiod_irq), ret);
957 client->irq = ret; 957 client->irq = ret;
958 958
959 return 0; 959 return 0;
@@ -1062,11 +1062,8 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
1062 1062
1063 phy = devm_kzalloc(&client->dev, sizeof(struct pn544_i2c_phy), 1063 phy = devm_kzalloc(&client->dev, sizeof(struct pn544_i2c_phy),
1064 GFP_KERNEL); 1064 GFP_KERNEL);
1065 if (!phy) { 1065 if (!phy)
1066 nfc_err(&client->dev,
1067 "Cannot allocate memory for pn544 i2c phy.\n");
1068 return -ENOMEM; 1066 return -ENOMEM;
1069 }
1070 1067
1071 INIT_WORK(&phy->fw_work, pn544_hci_i2c_fw_work); 1068 INIT_WORK(&phy->fw_work, pn544_hci_i2c_fw_work);
1072 phy->fw_work_state = FW_WORK_STATE_IDLE; 1069 phy->fw_work_state = FW_WORK_STATE_IDLE;
diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
index 4ac4d31f6c59..87d509996704 100644
--- a/drivers/nfc/port100.c
+++ b/drivers/nfc/port100.c
@@ -604,11 +604,11 @@ static void port100_recv_response(struct urb *urb)
604 case -ECONNRESET: 604 case -ECONNRESET:
605 case -ENOENT: 605 case -ENOENT:
606 nfc_err(&dev->interface->dev, 606 nfc_err(&dev->interface->dev,
607 "The urb has been canceled (status %d)", urb->status); 607 "The urb has been canceled (status %d)\n", urb->status);
608 goto sched_wq; 608 goto sched_wq;
609 case -ESHUTDOWN: 609 case -ESHUTDOWN:
610 default: 610 default:
611 nfc_err(&dev->interface->dev, "Urb failure (status %d)", 611 nfc_err(&dev->interface->dev, "Urb failure (status %d)\n",
612 urb->status); 612 urb->status);
613 goto sched_wq; 613 goto sched_wq;
614 } 614 }
@@ -616,7 +616,7 @@ static void port100_recv_response(struct urb *urb)
616 in_frame = dev->in_urb->transfer_buffer; 616 in_frame = dev->in_urb->transfer_buffer;
617 617
618 if (!port100_rx_frame_is_valid(in_frame)) { 618 if (!port100_rx_frame_is_valid(in_frame)) {
619 nfc_err(&dev->interface->dev, "Received an invalid frame"); 619 nfc_err(&dev->interface->dev, "Received an invalid frame\n");
620 cmd->status = -EIO; 620 cmd->status = -EIO;
621 goto sched_wq; 621 goto sched_wq;
622 } 622 }
@@ -626,7 +626,7 @@ static void port100_recv_response(struct urb *urb)
626 626
627 if (!port100_rx_frame_is_cmd_response(dev, in_frame)) { 627 if (!port100_rx_frame_is_cmd_response(dev, in_frame)) {
628 nfc_err(&dev->interface->dev, 628 nfc_err(&dev->interface->dev,
629 "It's not the response to the last command"); 629 "It's not the response to the last command\n");
630 cmd->status = -EIO; 630 cmd->status = -EIO;
631 goto sched_wq; 631 goto sched_wq;
632 } 632 }
@@ -657,11 +657,11 @@ static void port100_recv_ack(struct urb *urb)
657 case -ECONNRESET: 657 case -ECONNRESET:
658 case -ENOENT: 658 case -ENOENT:
659 nfc_err(&dev->interface->dev, 659 nfc_err(&dev->interface->dev,
660 "The urb has been stopped (status %d)", urb->status); 660 "The urb has been stopped (status %d)\n", urb->status);
661 goto sched_wq; 661 goto sched_wq;
662 case -ESHUTDOWN: 662 case -ESHUTDOWN:
663 default: 663 default:
664 nfc_err(&dev->interface->dev, "Urb failure (status %d)", 664 nfc_err(&dev->interface->dev, "Urb failure (status %d)\n",
665 urb->status); 665 urb->status);
666 goto sched_wq; 666 goto sched_wq;
667 } 667 }
@@ -669,7 +669,7 @@ static void port100_recv_ack(struct urb *urb)
669 in_frame = dev->in_urb->transfer_buffer; 669 in_frame = dev->in_urb->transfer_buffer;
670 670
671 if (!port100_rx_frame_is_ack(in_frame)) { 671 if (!port100_rx_frame_is_ack(in_frame)) {
672 nfc_err(&dev->interface->dev, "Received an invalid ack"); 672 nfc_err(&dev->interface->dev, "Received an invalid ack\n");
673 cmd->status = -EIO; 673 cmd->status = -EIO;
674 goto sched_wq; 674 goto sched_wq;
675 } 675 }
@@ -677,7 +677,7 @@ static void port100_recv_ack(struct urb *urb)
677 rc = port100_submit_urb_for_response(dev, GFP_ATOMIC); 677 rc = port100_submit_urb_for_response(dev, GFP_ATOMIC);
678 if (rc) { 678 if (rc) {
679 nfc_err(&dev->interface->dev, 679 nfc_err(&dev->interface->dev,
680 "usb_submit_urb failed with result %d", rc); 680 "usb_submit_urb failed with result %d\n", rc);
681 cmd->status = rc; 681 cmd->status = rc;
682 goto sched_wq; 682 goto sched_wq;
683 } 683 }
@@ -873,11 +873,11 @@ static void port100_send_complete(struct urb *urb)
873 case -ECONNRESET: 873 case -ECONNRESET:
874 case -ENOENT: 874 case -ENOENT:
875 nfc_err(&dev->interface->dev, 875 nfc_err(&dev->interface->dev,
876 "The urb has been stopped (status %d)", urb->status); 876 "The urb has been stopped (status %d)\n", urb->status);
877 break; 877 break;
878 case -ESHUTDOWN: 878 case -ESHUTDOWN:
879 default: 879 default:
880 nfc_err(&dev->interface->dev, "Urb failure (status %d)", 880 nfc_err(&dev->interface->dev, "Urb failure (status %d)\n",
881 urb->status); 881 urb->status);
882 } 882 }
883} 883}
@@ -1094,7 +1094,7 @@ static void port100_in_comm_rf_complete(struct port100 *dev, void *arg,
1094 1094
1095 if (resp->len < 4) { 1095 if (resp->len < 4) {
1096 nfc_err(&dev->interface->dev, 1096 nfc_err(&dev->interface->dev,
1097 "Invalid packet length received.\n"); 1097 "Invalid packet length received\n");
1098 rc = -EIO; 1098 rc = -EIO;
1099 goto error; 1099 goto error;
1100 } 1100 }
@@ -1250,7 +1250,7 @@ static bool port100_tg_target_activated(struct port100 *dev, u8 tgt_activated)
1250 PORT100_MDAA_TGT_WAS_ACTIVATED_MASK; 1250 PORT100_MDAA_TGT_WAS_ACTIVATED_MASK;
1251 break; 1251 break;
1252 default: 1252 default:
1253 nfc_err(&dev->interface->dev, "Unknonwn command type.\n"); 1253 nfc_err(&dev->interface->dev, "Unknown command type\n");
1254 return false; 1254 return false;
1255 } 1255 }
1256 1256
@@ -1481,7 +1481,7 @@ static int port100_probe(struct usb_interface *interface,
1481 cmd_type_mask = port100_get_command_type_mask(dev); 1481 cmd_type_mask = port100_get_command_type_mask(dev);
1482 if (!cmd_type_mask) { 1482 if (!cmd_type_mask) {
1483 nfc_err(&interface->dev, 1483 nfc_err(&interface->dev,
1484 "Could not get supported command types.\n"); 1484 "Could not get supported command types\n");
1485 rc = -ENODEV; 1485 rc = -ENODEV;
1486 goto error; 1486 goto error;
1487 } 1487 }
@@ -1494,7 +1494,7 @@ static int port100_probe(struct usb_interface *interface,
1494 rc = port100_set_command_type(dev, dev->cmd_type); 1494 rc = port100_set_command_type(dev, dev->cmd_type);
1495 if (rc) { 1495 if (rc) {
1496 nfc_err(&interface->dev, 1496 nfc_err(&interface->dev,
1497 "The device does not support command type %u.\n", 1497 "The device does not support command type %u\n",
1498 dev->cmd_type); 1498 dev->cmd_type);
1499 goto error; 1499 goto error;
1500 } 1500 }
@@ -1502,7 +1502,7 @@ static int port100_probe(struct usb_interface *interface,
1502 fw_version = port100_get_firmware_version(dev); 1502 fw_version = port100_get_firmware_version(dev);
1503 if (!fw_version) 1503 if (!fw_version)
1504 nfc_err(&interface->dev, 1504 nfc_err(&interface->dev,
1505 "Could not get device firmware version.\n"); 1505 "Could not get device firmware version\n");
1506 1506
1507 nfc_info(&interface->dev, 1507 nfc_info(&interface->dev,
1508 "Sony NFC Port-100 Series attached (firmware v%x.%02x)\n", 1508 "Sony NFC Port-100 Series attached (firmware v%x.%02x)\n",
@@ -1515,7 +1515,7 @@ static int port100_probe(struct usb_interface *interface,
1515 dev->skb_tailroom); 1515 dev->skb_tailroom);
1516 if (!dev->nfc_digital_dev) { 1516 if (!dev->nfc_digital_dev) {
1517 nfc_err(&interface->dev, 1517 nfc_err(&interface->dev,
1518 "Could not allocate nfc_digital_dev.\n"); 1518 "Could not allocate nfc_digital_dev\n");
1519 rc = -ENOMEM; 1519 rc = -ENOMEM;
1520 goto error; 1520 goto error;
1521 } 1521 }
@@ -1526,7 +1526,7 @@ static int port100_probe(struct usb_interface *interface,
1526 rc = nfc_digital_register_device(dev->nfc_digital_dev); 1526 rc = nfc_digital_register_device(dev->nfc_digital_dev);
1527 if (rc) { 1527 if (rc) {
1528 nfc_err(&interface->dev, 1528 nfc_err(&interface->dev,
1529 "Could not register digital device.\n"); 1529 "Could not register digital device\n");
1530 goto free_nfc_dev; 1530 goto free_nfc_dev;
1531 } 1531 }
1532 1532
@@ -1562,7 +1562,7 @@ static void port100_disconnect(struct usb_interface *interface)
1562 1562
1563 kfree(dev->cmd); 1563 kfree(dev->cmd);
1564 1564
1565 nfc_info(&interface->dev, "Sony Port-100 NFC device disconnected"); 1565 nfc_info(&interface->dev, "Sony Port-100 NFC device disconnected\n");
1566} 1566}
1567 1567
1568static struct usb_driver port100_driver = { 1568static struct usb_driver port100_driver = {
diff --git a/drivers/nfc/st21nfcb/i2c.c b/drivers/nfc/st21nfcb/i2c.c
index 7b53a5c84041..76a4cad41cec 100644
--- a/drivers/nfc/st21nfcb/i2c.c
+++ b/drivers/nfc/st21nfcb/i2c.c
@@ -313,11 +313,8 @@ static int st21nfcb_nci_i2c_probe(struct i2c_client *client,
313 313
314 phy = devm_kzalloc(&client->dev, sizeof(struct st21nfcb_i2c_phy), 314 phy = devm_kzalloc(&client->dev, sizeof(struct st21nfcb_i2c_phy),
315 GFP_KERNEL); 315 GFP_KERNEL);
316 if (!phy) { 316 if (!phy)
317 nfc_err(&client->dev,
318 "Cannot allocate memory for st21nfcb i2c phy.\n");
319 return -ENOMEM; 317 return -ENOMEM;
320 }
321 318
322 phy->i2c_dev = client; 319 phy->i2c_dev = client;
323 320
diff --git a/drivers/nfc/st21nfcb/ndlc.c b/drivers/nfc/st21nfcb/ndlc.c
index 5fbf59d2138c..6014b5859465 100644
--- a/drivers/nfc/st21nfcb/ndlc.c
+++ b/drivers/nfc/st21nfcb/ndlc.c
@@ -256,10 +256,9 @@ int ndlc_probe(void *phy_id, struct nfc_phy_ops *phy_ops, struct device *dev,
256 struct llt_ndlc *ndlc; 256 struct llt_ndlc *ndlc;
257 257
258 ndlc = devm_kzalloc(dev, sizeof(struct llt_ndlc), GFP_KERNEL); 258 ndlc = devm_kzalloc(dev, sizeof(struct llt_ndlc), GFP_KERNEL);
259 if (!ndlc) { 259 if (!ndlc)
260 nfc_err(dev, "Cannot allocate memory for ndlc.\n");
261 return -ENOMEM; 260 return -ENOMEM;
262 } 261
263 ndlc->ops = phy_ops; 262 ndlc->ops = phy_ops;
264 ndlc->phy_id = phy_id; 263 ndlc->phy_id = phy_id;
265 ndlc->dev = dev; 264 ndlc->dev = dev;