summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-09-20 09:05:48 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-09-25 02:02:32 +0200
commitc5da0e4a35eb1eba0c1593bef4bf2b58d9d50d6b (patch)
tree105725b6dfa76a4deffd6fce0cc4d7b2b0361a3c
parent645d5087bd9667ed398bcb4bfd8784e1de1ee693 (diff)
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>
-rw-r--r--net/nfc/digital.h6
-rw-r--r--net/nfc/digital_core.c34
-rw-r--r--net/nfc/digital_dep.c14
-rw-r--r--net/nfc/digital_technology.c4
4 files changed, 31 insertions, 27 deletions
diff --git a/net/nfc/digital.h b/net/nfc/digital.h
index 586075a3feed..08b29b55ea63 100644
--- a/net/nfc/digital.h
+++ b/net/nfc/digital.h
@@ -22,10 +22,8 @@
#include <linux/crc-ccitt.h>
#include <linux/crc-itu-t.h>
-#define PR_DBG(fmt, ...) pr_debug("%s: " fmt "\n", __func__, ##__VA_ARGS__)
-#define PR_ERR(fmt, ...) pr_err("%s: " fmt "\n", __func__, ##__VA_ARGS__)
-#define PROTOCOL_ERR(req) pr_err("%s:%d: NFC Digital Protocol error: %s\n", \
- __func__, __LINE__, req)
+#define PROTOCOL_ERR(req) pr_err("%d: NFC Digital Protocol error: %s\n", \
+ __LINE__, req)
#define DIGITAL_CMD_IN_SEND 0
#define DIGITAL_CMD_TG_SEND 1
diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c
index 66151fc5d990..6f563d09b520 100644
--- a/net/nfc/digital_core.c
+++ b/net/nfc/digital_core.c
@@ -13,6 +13,8 @@
*
*/
+#define pr_fmt(fmt) "digital: %s: " fmt, __func__
+
#include <linux/module.h>
#include "digital.h"
@@ -196,14 +198,14 @@ static void digital_wq_cmd(struct work_struct *work)
break;
default:
- PR_ERR("Unknown cmd type %d", cmd->type);
+ pr_err("Unknown cmd type %d", cmd->type);
return;
}
if (!rc)
return;
- PR_ERR("in_send_command returned err %d", rc);
+ pr_err("in_send_command returned err %d", rc);
mutex_lock(&ddev->cmd_lock);
list_del(&cmd->queue);
@@ -250,7 +252,7 @@ int digital_in_configure_hw(struct nfc_digital_dev *ddev, int type, int param)
rc = ddev->ops->in_configure_hw(ddev, type, param);
if (rc)
- PR_ERR("in_configure_hw failed: %d", rc);
+ pr_err("in_configure_hw failed: %d", rc);
return rc;
}
@@ -261,7 +263,7 @@ int digital_tg_configure_hw(struct nfc_digital_dev *ddev, int type, int param)
rc = ddev->ops->tg_configure_hw(ddev, type, param);
if (rc)
- PR_ERR("tg_configure_hw failed: %d", rc);
+ pr_err("tg_configure_hw failed: %d", rc);
return rc;
}
@@ -330,11 +332,11 @@ int digital_target_found(struct nfc_digital_dev *ddev,
break;
default:
- PR_ERR("Invalid protocol %d", protocol);
+ pr_err("Invalid protocol %d", protocol);
return -EINVAL;
}
- PR_DBG("rf_tech=%d, protocol=%d", rf_tech, protocol);
+ pr_debug("rf_tech=%d, protocol=%d", rf_tech, protocol);
ddev->curr_rf_tech = rf_tech;
ddev->curr_protocol = protocol;
@@ -432,24 +434,24 @@ static int digital_start_poll(struct nfc_dev *nfc_dev, __u32 im_protocols,
struct nfc_digital_dev *ddev = nfc_get_drvdata(nfc_dev);
u32 matching_im_protocols, matching_tm_protocols;
- PR_DBG("protocols: im 0x%x, tm 0x%x, supported 0x%x", im_protocols,
- tm_protocols, ddev->protocols);
+ pr_debug("protocols: im 0x%x, tm 0x%x, supported 0x%x", im_protocols,
+ tm_protocols, ddev->protocols);
matching_im_protocols = ddev->protocols & im_protocols;
matching_tm_protocols = ddev->protocols & tm_protocols;
if (!matching_im_protocols && !matching_tm_protocols) {
- PR_ERR("No known protocol");
+ pr_err("No known protocol");
return -EINVAL;
}
if (ddev->poll_tech_count) {
- PR_ERR("Already polling");
+ pr_err("Already polling");
return -EBUSY;
}
if (ddev->curr_protocol) {
- PR_ERR("A target is already active");
+ pr_err("A target is already active");
return -EBUSY;
}
@@ -485,7 +487,7 @@ static int digital_start_poll(struct nfc_dev *nfc_dev, __u32 im_protocols,
}
if (!ddev->poll_tech_count) {
- PR_ERR("Unsupported protocols: im=0x%x, tm=0x%x",
+ pr_err("Unsupported protocols: im=0x%x, tm=0x%x",
matching_im_protocols, matching_tm_protocols);
return -EINVAL;
}
@@ -502,7 +504,7 @@ static void digital_stop_poll(struct nfc_dev *nfc_dev)
mutex_lock(&ddev->poll_lock);
if (!ddev->poll_tech_count) {
- PR_ERR("Polling operation was not running");
+ pr_err("Polling operation was not running");
mutex_unlock(&ddev->poll_lock);
return;
}
@@ -609,7 +611,7 @@ static int digital_in_send(struct nfc_dev *nfc_dev, struct nfc_target *target,
data_exch = kzalloc(sizeof(struct digital_data_exch), GFP_KERNEL);
if (!data_exch) {
- PR_ERR("Failed to allocate data_exch struct");
+ pr_err("Failed to allocate data_exch struct");
return -ENOMEM;
}
@@ -652,7 +654,7 @@ struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops,
ddev = kzalloc(sizeof(struct nfc_digital_dev), GFP_KERNEL);
if (!ddev) {
- PR_ERR("kzalloc failed");
+ pr_err("kzalloc failed");
return NULL;
}
@@ -684,7 +686,7 @@ struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops,
ddev->tx_headroom,
ddev->tx_tailroom);
if (!ddev->nfc_dev) {
- PR_ERR("nfc_allocate_device failed");
+ pr_err("nfc_allocate_device failed");
goto free_dev;
}
diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c
index 810d00c9cd5d..15f140ae9099 100644
--- a/net/nfc/digital_dep.c
+++ b/net/nfc/digital_dep.c
@@ -13,6 +13,8 @@
*
*/
+#define pr_fmt(fmt) "digital: %s: " fmt, __func__
+
#include "digital.h"
#define DIGITAL_NFC_DEP_FRAME_DIR_OUT 0xD4
@@ -313,7 +315,7 @@ static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg,
break;
case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
- PR_ERR("Received a ACK/NACK PDU");
+ pr_err("Received a ACK/NACK PDU");
rc = -EIO;
goto error;
@@ -332,7 +334,7 @@ static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg,
}
if (DIGITAL_NFC_DEP_MI_BIT_SET(pfb)) {
- PR_ERR("MI bit set. Chained PDU not supported.");
+ pr_err("MI bit set. Chained PDU not supported.");
rc = -EIO;
goto error;
}
@@ -424,16 +426,16 @@ static void digital_tg_recv_dep_req(struct nfc_digital_dev *ddev, void *arg,
switch (DIGITAL_NFC_DEP_PFB_TYPE(dep_req->pfb)) {
case DIGITAL_NFC_DEP_PFB_I_PDU:
- PR_DBG("DIGITAL_NFC_DEP_PFB_I_PDU");
+ pr_debug("DIGITAL_NFC_DEP_PFB_I_PDU");
ddev->curr_nfc_dep_pni = DIGITAL_NFC_DEP_PFB_PNI(dep_req->pfb);
break;
case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
- PR_ERR("Received a ACK/NACK PDU");
+ pr_err("Received a ACK/NACK PDU");
rc = -EINVAL;
goto exit;
break;
case DIGITAL_NFC_DEP_PFB_SUPERVISOR_PDU:
- PR_ERR("Received a SUPERVISOR PDU");
+ pr_err("Received a SUPERVISOR PDU");
rc = -EINVAL;
goto exit;
break;
@@ -561,7 +563,7 @@ static void digital_tg_recv_psl_req(struct nfc_digital_dev *ddev, void *arg,
rf_tech = NFC_DIGITAL_RF_TECH_424F;
break;
default:
- PR_ERR("Unsuported dsi value %d", dsi);
+ pr_err("Unsuported dsi value %d", dsi);
goto exit;
}
diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c
index 564735fbbd8f..5a13e1bb1e68 100644
--- a/net/nfc/digital_technology.c
+++ b/net/nfc/digital_technology.c
@@ -13,6 +13,8 @@
*
*/
+#define pr_fmt(fmt) "digital: %s: " fmt, __func__
+
#include "digital.h"
#define DIGITAL_CMD_SENS_REQ 0x26
@@ -258,7 +260,7 @@ static int digital_in_send_sdd_req(struct nfc_digital_dev *ddev,
skb = digital_skb_alloc(ddev, 2);
if (!skb) {
- PR_ERR("alloc_skb failed");
+ pr_err("alloc_skb failed");
return -ENOMEM;
}