Commit c5da0e4a35eb1eba0c1593bef4bf2b58d9d50d6b

Authored by Samuel Ortiz
1 parent 645d5087bd

NFC: digital: Remove PR_ERR and PR_DBG macros

They can be replaced by the standard pr_err and pr_debug one after
defining the right pr_fmt macro.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

Showing 4 changed files with 31 additions and 27 deletions Side-by-side Diff

... ... @@ -22,10 +22,8 @@
22 22 #include <linux/crc-ccitt.h>
23 23 #include <linux/crc-itu-t.h>
24 24  
25   -#define PR_DBG(fmt, ...) pr_debug("%s: " fmt "\n", __func__, ##__VA_ARGS__)
26   -#define PR_ERR(fmt, ...) pr_err("%s: " fmt "\n", __func__, ##__VA_ARGS__)
27   -#define PROTOCOL_ERR(req) pr_err("%s:%d: NFC Digital Protocol error: %s\n", \
28   - __func__, __LINE__, req)
  25 +#define PROTOCOL_ERR(req) pr_err("%d: NFC Digital Protocol error: %s\n", \
  26 + __LINE__, req)
29 27  
30 28 #define DIGITAL_CMD_IN_SEND 0
31 29 #define DIGITAL_CMD_TG_SEND 1
net/nfc/digital_core.c
... ... @@ -13,6 +13,8 @@
13 13 *
14 14 */
15 15  
  16 +#define pr_fmt(fmt) "digital: %s: " fmt, __func__
  17 +
16 18 #include <linux/module.h>
17 19  
18 20 #include "digital.h"
19 21  
... ... @@ -196,14 +198,14 @@
196 198 break;
197 199  
198 200 default:
199   - PR_ERR("Unknown cmd type %d", cmd->type);
  201 + pr_err("Unknown cmd type %d", cmd->type);
200 202 return;
201 203 }
202 204  
203 205 if (!rc)
204 206 return;
205 207  
206   - PR_ERR("in_send_command returned err %d", rc);
  208 + pr_err("in_send_command returned err %d", rc);
207 209  
208 210 mutex_lock(&ddev->cmd_lock);
209 211 list_del(&cmd->queue);
... ... @@ -250,7 +252,7 @@
250 252  
251 253 rc = ddev->ops->in_configure_hw(ddev, type, param);
252 254 if (rc)
253   - PR_ERR("in_configure_hw failed: %d", rc);
  255 + pr_err("in_configure_hw failed: %d", rc);
254 256  
255 257 return rc;
256 258 }
... ... @@ -261,7 +263,7 @@
261 263  
262 264 rc = ddev->ops->tg_configure_hw(ddev, type, param);
263 265 if (rc)
264   - PR_ERR("tg_configure_hw failed: %d", rc);
  266 + pr_err("tg_configure_hw failed: %d", rc);
265 267  
266 268 return rc;
267 269 }
268 270  
... ... @@ -330,11 +332,11 @@
330 332 break;
331 333  
332 334 default:
333   - PR_ERR("Invalid protocol %d", protocol);
  335 + pr_err("Invalid protocol %d", protocol);
334 336 return -EINVAL;
335 337 }
336 338  
337   - PR_DBG("rf_tech=%d, protocol=%d", rf_tech, protocol);
  339 + pr_debug("rf_tech=%d, protocol=%d", rf_tech, protocol);
338 340  
339 341 ddev->curr_rf_tech = rf_tech;
340 342 ddev->curr_protocol = protocol;
341 343  
342 344  
343 345  
... ... @@ -432,24 +434,24 @@
432 434 struct nfc_digital_dev *ddev = nfc_get_drvdata(nfc_dev);
433 435 u32 matching_im_protocols, matching_tm_protocols;
434 436  
435   - PR_DBG("protocols: im 0x%x, tm 0x%x, supported 0x%x", im_protocols,
436   - tm_protocols, ddev->protocols);
  437 + pr_debug("protocols: im 0x%x, tm 0x%x, supported 0x%x", im_protocols,
  438 + tm_protocols, ddev->protocols);
437 439  
438 440 matching_im_protocols = ddev->protocols & im_protocols;
439 441 matching_tm_protocols = ddev->protocols & tm_protocols;
440 442  
441 443 if (!matching_im_protocols && !matching_tm_protocols) {
442   - PR_ERR("No known protocol");
  444 + pr_err("No known protocol");
443 445 return -EINVAL;
444 446 }
445 447  
446 448 if (ddev->poll_tech_count) {
447   - PR_ERR("Already polling");
  449 + pr_err("Already polling");
448 450 return -EBUSY;
449 451 }
450 452  
451 453 if (ddev->curr_protocol) {
452   - PR_ERR("A target is already active");
  454 + pr_err("A target is already active");
453 455 return -EBUSY;
454 456 }
455 457  
... ... @@ -485,7 +487,7 @@
485 487 }
486 488  
487 489 if (!ddev->poll_tech_count) {
488   - PR_ERR("Unsupported protocols: im=0x%x, tm=0x%x",
  490 + pr_err("Unsupported protocols: im=0x%x, tm=0x%x",
489 491 matching_im_protocols, matching_tm_protocols);
490 492 return -EINVAL;
491 493 }
... ... @@ -502,7 +504,7 @@
502 504 mutex_lock(&ddev->poll_lock);
503 505  
504 506 if (!ddev->poll_tech_count) {
505   - PR_ERR("Polling operation was not running");
  507 + pr_err("Polling operation was not running");
506 508 mutex_unlock(&ddev->poll_lock);
507 509 return;
508 510 }
... ... @@ -609,7 +611,7 @@
609 611  
610 612 data_exch = kzalloc(sizeof(struct digital_data_exch), GFP_KERNEL);
611 613 if (!data_exch) {
612   - PR_ERR("Failed to allocate data_exch struct");
  614 + pr_err("Failed to allocate data_exch struct");
613 615 return -ENOMEM;
614 616 }
615 617  
... ... @@ -652,7 +654,7 @@
652 654  
653 655 ddev = kzalloc(sizeof(struct nfc_digital_dev), GFP_KERNEL);
654 656 if (!ddev) {
655   - PR_ERR("kzalloc failed");
  657 + pr_err("kzalloc failed");
656 658 return NULL;
657 659 }
658 660  
... ... @@ -684,7 +686,7 @@
684 686 ddev->tx_headroom,
685 687 ddev->tx_tailroom);
686 688 if (!ddev->nfc_dev) {
687   - PR_ERR("nfc_allocate_device failed");
  689 + pr_err("nfc_allocate_device failed");
688 690 goto free_dev;
689 691 }
690 692  
net/nfc/digital_dep.c
... ... @@ -13,6 +13,8 @@
13 13 *
14 14 */
15 15  
  16 +#define pr_fmt(fmt) "digital: %s: " fmt, __func__
  17 +
16 18 #include "digital.h"
17 19  
18 20 #define DIGITAL_NFC_DEP_FRAME_DIR_OUT 0xD4
... ... @@ -313,7 +315,7 @@
313 315 break;
314 316  
315 317 case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
316   - PR_ERR("Received a ACK/NACK PDU");
  318 + pr_err("Received a ACK/NACK PDU");
317 319 rc = -EIO;
318 320 goto error;
319 321  
... ... @@ -332,7 +334,7 @@
332 334 }
333 335  
334 336 if (DIGITAL_NFC_DEP_MI_BIT_SET(pfb)) {
335   - PR_ERR("MI bit set. Chained PDU not supported.");
  337 + pr_err("MI bit set. Chained PDU not supported.");
336 338 rc = -EIO;
337 339 goto error;
338 340 }
339 341  
340 342  
... ... @@ -424,16 +426,16 @@
424 426  
425 427 switch (DIGITAL_NFC_DEP_PFB_TYPE(dep_req->pfb)) {
426 428 case DIGITAL_NFC_DEP_PFB_I_PDU:
427   - PR_DBG("DIGITAL_NFC_DEP_PFB_I_PDU");
  429 + pr_debug("DIGITAL_NFC_DEP_PFB_I_PDU");
428 430 ddev->curr_nfc_dep_pni = DIGITAL_NFC_DEP_PFB_PNI(dep_req->pfb);
429 431 break;
430 432 case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
431   - PR_ERR("Received a ACK/NACK PDU");
  433 + pr_err("Received a ACK/NACK PDU");
432 434 rc = -EINVAL;
433 435 goto exit;
434 436 break;
435 437 case DIGITAL_NFC_DEP_PFB_SUPERVISOR_PDU:
436   - PR_ERR("Received a SUPERVISOR PDU");
  438 + pr_err("Received a SUPERVISOR PDU");
437 439 rc = -EINVAL;
438 440 goto exit;
439 441 break;
... ... @@ -561,7 +563,7 @@
561 563 rf_tech = NFC_DIGITAL_RF_TECH_424F;
562 564 break;
563 565 default:
564   - PR_ERR("Unsuported dsi value %d", dsi);
  566 + pr_err("Unsuported dsi value %d", dsi);
565 567 goto exit;
566 568 }
567 569  
net/nfc/digital_technology.c
... ... @@ -13,6 +13,8 @@
13 13 *
14 14 */
15 15  
  16 +#define pr_fmt(fmt) "digital: %s: " fmt, __func__
  17 +
16 18 #include "digital.h"
17 19  
18 20 #define DIGITAL_CMD_SENS_REQ 0x26
... ... @@ -258,7 +260,7 @@
258 260  
259 261 skb = digital_skb_alloc(ddev, 2);
260 262 if (!skb) {
261   - PR_ERR("alloc_skb failed");
  263 + pr_err("alloc_skb failed");
262 264 return -ENOMEM;
263 265 }
264 266