Commit b4834839 authored by Joe Perches's avatar Joe Perches Committed by Samuel Ortiz

NFC: Replace nfc_dev_dbg with dev_dbg

Use the generic kernel function instead of a home-grown
one that does the same thing.

Add \n to uses not at the macro.  Don't add \n where
the nfc_dev_dbg macro mistakenly had them already.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 39438261
......@@ -22,7 +22,7 @@
#define DEV_ERR(_dev, fmt, args...) nfc_dev_err(&_dev->nfc_dev->dev, \
"%s: " fmt, __func__, ## args)
#define DEV_DBG(_dev, fmt, args...) nfc_dev_dbg(&_dev->nfc_dev->dev, \
#define DEV_DBG(_dev, fmt, args...) dev_dbg(&_dev->nfc_dev->dev, \
"%s: " fmt, __func__, ## args)
#define NFCSIM_VERSION "0.1"
......@@ -64,7 +64,7 @@ static struct workqueue_struct *wq;
static void nfcsim_cleanup_dev(struct nfcsim *dev, u8 shutdown)
{
DEV_DBG(dev, "shutdown=%d", shutdown);
DEV_DBG(dev, "shutdown=%d\n", shutdown);
mutex_lock(&dev->lock);
......@@ -84,7 +84,7 @@ static int nfcsim_target_found(struct nfcsim *dev)
{
struct nfc_target nfc_tgt;
DEV_DBG(dev, "");
DEV_DBG(dev, "\n");
memset(&nfc_tgt, 0, sizeof(struct nfc_target));
......@@ -98,7 +98,7 @@ static int nfcsim_dev_up(struct nfc_dev *nfc_dev)
{
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
DEV_DBG(dev, "");
DEV_DBG(dev, "\n");
mutex_lock(&dev->lock);
......@@ -113,7 +113,7 @@ static int nfcsim_dev_down(struct nfc_dev *nfc_dev)
{
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
DEV_DBG(dev, "");
DEV_DBG(dev, "\n");
mutex_lock(&dev->lock);
......@@ -172,7 +172,7 @@ static int nfcsim_dep_link_down(struct nfc_dev *nfc_dev)
{
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
DEV_DBG(dev, "");
DEV_DBG(dev, "\n");
nfcsim_cleanup_dev(dev, 0);
......@@ -210,7 +210,7 @@ static int nfcsim_start_poll(struct nfc_dev *nfc_dev,
queue_delayed_work(wq, &dev->poll_work, 0);
DEV_DBG(dev, "Start polling: im: 0x%X, tm: 0x%X", im_protocols,
DEV_DBG(dev, "Start polling: im: 0x%X, tm: 0x%X\n", im_protocols,
tm_protocols);
rc = 0;
......@@ -224,7 +224,7 @@ static void nfcsim_stop_poll(struct nfc_dev *nfc_dev)
{
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
DEV_DBG(dev, "Stop poll");
DEV_DBG(dev, "Stop poll\n");
mutex_lock(&dev->lock);
......@@ -240,7 +240,7 @@ static int nfcsim_activate_target(struct nfc_dev *nfc_dev,
{
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
DEV_DBG(dev, "");
DEV_DBG(dev, "\n");
return -ENOTSUPP;
}
......@@ -250,7 +250,7 @@ static void nfcsim_deactivate_target(struct nfc_dev *nfc_dev,
{
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
DEV_DBG(dev, "");
DEV_DBG(dev, "\n");
}
static void nfcsim_wq_recv(struct work_struct *work)
......@@ -397,13 +397,13 @@ static void nfcsim_wq_poll(struct work_struct *work)
nfcsim_set_polling_mode(dev);
if (dev->curr_polling_mode == NFCSIM_POLL_NONE) {
DEV_DBG(dev, "Not polling");
DEV_DBG(dev, "Not polling\n");
goto unlock;
}
DEV_DBG(dev, "Polling as %s",
dev->curr_polling_mode == NFCSIM_POLL_INITIATOR ?
"initiator" : "target");
"initiator\n" : "target\n");
if (dev->curr_polling_mode == NFCSIM_POLL_TARGET)
goto sched_work;
......
......@@ -146,8 +146,6 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
unsigned long comp_ret;
int rc;
nfc_dev_dbg(&drv->pdev->dev, "get_bts_file_name entry");
skb = nfcwilink_skb_alloc(sizeof(struct nci_vs_nfcc_info_cmd),
GFP_KERNEL);
if (!skb) {
......@@ -170,17 +168,16 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
comp_ret = wait_for_completion_timeout(&drv->completed,
msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
nfc_dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld",
comp_ret);
dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
comp_ret);
if (comp_ret == 0) {
nfc_dev_err(&drv->pdev->dev,
"timeout on wait_for_completion_timeout");
dev_err(&drv->pdev->dev,
"timeout on wait_for_completion_timeout\n");
return -ETIMEDOUT;
}
nfc_dev_dbg(&drv->pdev->dev, "nci_vs_nfcc_info_rsp: plen %d, status %d",
drv->nfcc_info.plen,
drv->nfcc_info.status);
dev_dbg(&drv->pdev->dev, "nci_vs_nfcc_info_rsp: plen %d, status %d\n",
drv->nfcc_info.plen, drv->nfcc_info.status);
if ((drv->nfcc_info.plen != 5) || (drv->nfcc_info.status != 0)) {
nfc_dev_err(&drv->pdev->dev,
......@@ -207,8 +204,6 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
unsigned long comp_ret;
int rc;
nfc_dev_dbg(&drv->pdev->dev, "send_bts_cmd entry");
/* verify valid cmd for the NFC channel */
if ((len <= sizeof(struct nfcwilink_hdr)) ||
(len > BTS_FILE_CMD_MAX_LEN) ||
......@@ -238,8 +233,8 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
comp_ret = wait_for_completion_timeout(&drv->completed,
msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
nfc_dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld",
comp_ret);
dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
comp_ret);
if (comp_ret == 0) {
nfc_dev_err(&drv->pdev->dev,
"timeout on wait_for_completion_timeout");
......@@ -257,8 +252,6 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
__u8 *ptr;
int len, rc;
nfc_dev_dbg(&drv->pdev->dev, "download_fw entry");
set_bit(NFCWILINK_FW_DOWNLOAD, &drv->flags);
rc = nfcwilink_get_bts_file_name(drv, file_name);
......@@ -280,8 +273,8 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
ptr = (__u8 *)fw->data;
if ((len == 0) || (ptr == NULL)) {
nfc_dev_dbg(&drv->pdev->dev,
"request_firmware returned size %d", len);
dev_dbg(&drv->pdev->dev,
"request_firmware returned size %d\n", len);
goto release_fw;
}
......@@ -302,8 +295,8 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
action_len =
__le16_to_cpu(((struct bts_file_action *)ptr)->len);
nfc_dev_dbg(&drv->pdev->dev, "bts_file_action type %d, len %d",
action_type, action_len);
dev_dbg(&drv->pdev->dev, "bts_file_action type %d, len %d\n",
action_type, action_len);
switch (action_type) {
case BTS_FILE_ACTION_TYPE_SEND_CMD:
......@@ -333,8 +326,6 @@ static void nfcwilink_register_complete(void *priv_data, char data)
{
struct nfcwilink *drv = priv_data;
nfc_dev_dbg(&drv->pdev->dev, "register_complete entry");
/* store ST registration status */
drv->st_register_cb_status = data;
......@@ -356,7 +347,7 @@ static long nfcwilink_receive(void *priv_data, struct sk_buff *skb)
return -EFAULT;
}
nfc_dev_dbg(&drv->pdev->dev, "receive entry, len %d", skb->len);
dev_dbg(&drv->pdev->dev, "receive entry, len %d\n", skb->len);
/* strip the ST header
(apart for the chnl byte, which is not received in the hdr) */
......@@ -396,8 +387,6 @@ static int nfcwilink_open(struct nci_dev *ndev)
unsigned long comp_ret;
int rc;
nfc_dev_dbg(&drv->pdev->dev, "open entry");
if (test_and_set_bit(NFCWILINK_RUNNING, &drv->flags)) {
rc = -EBUSY;
goto exit;
......@@ -415,9 +404,9 @@ static int nfcwilink_open(struct nci_dev *ndev)
&drv->completed,
msecs_to_jiffies(NFCWILINK_REGISTER_TIMEOUT));
nfc_dev_dbg(&drv->pdev->dev,
"wait_for_completion_timeout returned %ld",
comp_ret);
dev_dbg(&drv->pdev->dev,
"wait_for_completion_timeout returned %ld\n",
comp_ret);
if (comp_ret == 0) {
/* timeout */
......@@ -460,8 +449,6 @@ static int nfcwilink_close(struct nci_dev *ndev)
struct nfcwilink *drv = nci_get_drvdata(ndev);
int rc;
nfc_dev_dbg(&drv->pdev->dev, "close entry");
if (!test_and_clear_bit(NFCWILINK_RUNNING, &drv->flags))
return 0;
......@@ -480,7 +467,7 @@ static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb)
struct nfcwilink_hdr hdr = {NFCWILINK_CHNL, NFCWILINK_OPCODE, 0x0000};
long len;
nfc_dev_dbg(&drv->pdev->dev, "send entry, len %d", skb->len);
dev_dbg(&drv->pdev->dev, "send entry, len %d\n", skb->len);
if (!test_bit(NFCWILINK_RUNNING, &drv->flags)) {
kfree_skb(skb);
......@@ -517,8 +504,6 @@ static int nfcwilink_probe(struct platform_device *pdev)
int rc;
__u32 protocols;
nfc_dev_dbg(&pdev->dev, "probe entry");
drv = devm_kzalloc(&pdev->dev, sizeof(struct nfcwilink), GFP_KERNEL);
if (!drv) {
rc = -ENOMEM;
......@@ -568,8 +553,6 @@ static int nfcwilink_remove(struct platform_device *pdev)
struct nfcwilink *drv = dev_get_drvdata(&pdev->dev);
struct nci_dev *ndev;
nfc_dev_dbg(&pdev->dev, "remove entry");
if (!drv)
return -EFAULT;
......
This diff is collapsed.
......@@ -30,7 +30,6 @@
#define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt "\n", ## arg)
#define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "NFC: " fmt "\n", ## arg)
#define nfc_dev_dbg(dev, fmt, arg...) dev_dbg((dev), fmt "\n", ## arg)
struct nfc_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment