Skip to content

Commit

Permalink
NFC: Replace nfc_dev_dbg with dev_dbg
Browse files Browse the repository at this point in the history
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: Joe Perches <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
JoePerches authored and Samuel Ortiz committed Sep 24, 2013
1 parent 3943826 commit b483483
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 122 deletions.
24 changes: 12 additions & 12 deletions drivers/nfc/nfcsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);

Expand All @@ -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));

Expand All @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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);

Expand All @@ -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;
}
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
51 changes: 17 additions & 34 deletions drivers/nfc/nfcwilink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand All @@ -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) ||
Expand Down Expand Up @@ -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");
Expand All @@ -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);
Expand All @@ -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;
}

Expand All @@ -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:
Expand Down Expand Up @@ -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;

Expand All @@ -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) */
Expand Down Expand Up @@ -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;
Expand All @@ -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 */
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
Loading

0 comments on commit b483483

Please sign in to comment.