Commit 073a625f authored by Joe Perches's avatar Joe Perches Committed by Samuel Ortiz

NFC: Convert nfc_dev_info and nfc_dev_err to nfc_<level>

Use a more standard kernel style macro logging name.

Standardize the spacing of the "NFC: " prefix.
Add \n to uses, remove from macro.
Fix the defective uses that already had a \n.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent b4834839
......@@ -19,7 +19,7 @@
#include <linux/nfc.h>
#include <net/nfc/nfc.h>
#define DEV_ERR(_dev, fmt, args...) nfc_dev_err(&_dev->nfc_dev->dev, \
#define DEV_ERR(_dev, fmt, args...) nfc_err(&_dev->nfc_dev->dev, \
"%s: " fmt, __func__, ## args)
#define DEV_DBG(_dev, fmt, args...) dev_dbg(&_dev->nfc_dev->dev, \
......@@ -143,7 +143,7 @@ static int nfcsim_dep_link_up(struct nfc_dev *nfc_dev,
remote_gb = nfc_get_local_general_bytes(peer->nfc_dev, &remote_gb_len);
if (!remote_gb) {
DEV_ERR(peer, "Can't get remote general bytes");
DEV_ERR(peer, "Can't get remote general bytes\n");
mutex_unlock(&peer->lock);
return -EINVAL;
......@@ -155,7 +155,7 @@ static int nfcsim_dep_link_up(struct nfc_dev *nfc_dev,
rc = nfc_set_remote_general_bytes(nfc_dev, remote_gb, remote_gb_len);
if (rc) {
DEV_ERR(dev, "Can't set remote general bytes");
DEV_ERR(dev, "Can't set remote general bytes\n");
mutex_unlock(&dev->lock);
return rc;
}
......@@ -188,7 +188,7 @@ static int nfcsim_start_poll(struct nfc_dev *nfc_dev,
mutex_lock(&dev->lock);
if (dev->polling_mode != NFCSIM_POLL_NONE) {
DEV_ERR(dev, "Already in polling mode");
DEV_ERR(dev, "Already in polling mode\n");
rc = -EBUSY;
goto exit;
}
......@@ -200,7 +200,7 @@ static int nfcsim_start_poll(struct nfc_dev *nfc_dev,
dev->polling_mode |= NFCSIM_POLL_TARGET;
if (dev->polling_mode == NFCSIM_POLL_NONE) {
DEV_ERR(dev, "Unsupported polling mode");
DEV_ERR(dev, "Unsupported polling mode\n");
rc = -EINVAL;
goto exit;
}
......@@ -267,7 +267,7 @@ static void nfcsim_wq_recv(struct work_struct *work)
if (dev->initiator) {
if (!dev->cb) {
DEV_ERR(dev, "Null recv callback");
DEV_ERR(dev, "Null recv callback\n");
dev_kfree_skb(dev->clone_skb);
goto exit;
}
......@@ -310,7 +310,7 @@ static int nfcsim_tx(struct nfc_dev *nfc_dev, struct nfc_target *target,
peer->clone_skb = skb_clone(skb, GFP_KERNEL);
if (!peer->clone_skb) {
DEV_ERR(dev, "skb_clone failed");
DEV_ERR(dev, "skb_clone failed\n");
mutex_unlock(&peer->lock);
err = -ENOMEM;
goto exit;
......
......@@ -149,8 +149,8 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
skb = nfcwilink_skb_alloc(sizeof(struct nci_vs_nfcc_info_cmd),
GFP_KERNEL);
if (!skb) {
nfc_dev_err(&drv->pdev->dev,
"no memory for nci_vs_nfcc_info_cmd");
nfc_err(&drv->pdev->dev,
"no memory for nci_vs_nfcc_info_cmd\n");
return -ENOMEM;
}
......@@ -180,8 +180,7 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
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,
"invalid nci_vs_nfcc_info_rsp");
nfc_err(&drv->pdev->dev, "invalid nci_vs_nfcc_info_rsp\n");
return -EINVAL;
}
......@@ -192,7 +191,7 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
drv->nfcc_info.sw_ver_z,
drv->nfcc_info.patch_id);
nfc_dev_info(&drv->pdev->dev, "nfcwilink FW file name: %s", file_name);
nfc_info(&drv->pdev->dev, "nfcwilink FW file name: %s\n", file_name);
return 0;
}
......@@ -209,8 +208,8 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
(len > BTS_FILE_CMD_MAX_LEN) ||
(hdr->chnl != NFCWILINK_CHNL) ||
(hdr->opcode != NFCWILINK_OPCODE)) {
nfc_dev_err(&drv->pdev->dev,
"ignoring invalid bts cmd, len %d, chnl %d, opcode %d",
nfc_err(&drv->pdev->dev,
"ignoring invalid bts cmd, len %d, chnl %d, opcode %d\n",
len, hdr->chnl, hdr->opcode);
return 0;
}
......@@ -221,7 +220,7 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
skb = nfcwilink_skb_alloc(len, GFP_KERNEL);
if (!skb) {
nfc_dev_err(&drv->pdev->dev, "no memory for bts cmd");
nfc_err(&drv->pdev->dev, "no memory for bts cmd\n");
return -ENOMEM;
}
......@@ -236,8 +235,8 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
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");
nfc_err(&drv->pdev->dev,
"timeout on wait_for_completion_timeout\n");
return -ETIMEDOUT;
}
......@@ -260,7 +259,7 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
rc = request_firmware(&fw, file_name, &drv->pdev->dev);
if (rc) {
nfc_dev_err(&drv->pdev->dev, "request_firmware failed %d", rc);
nfc_err(&drv->pdev->dev, "request_firmware failed %d\n", rc);
/* if the file is not found, don't exit with failure */
if (rc == -ENOENT)
......@@ -280,7 +279,7 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
if (__le32_to_cpu(((struct bts_file_hdr *)ptr)->magic) !=
BTS_FILE_HDR_MAGIC) {
nfc_dev_err(&drv->pdev->dev, "wrong bts magic number");
nfc_err(&drv->pdev->dev, "wrong bts magic number\n");
rc = -EINVAL;
goto release_fw;
}
......@@ -361,7 +360,7 @@ static long nfcwilink_receive(void *priv_data, struct sk_buff *skb)
/* Forward skb to NCI core layer */
rc = nci_recv_frame(drv->ndev, skb);
if (rc < 0) {
nfc_dev_err(&drv->pdev->dev, "nci_recv_frame failed %d", rc);
nfc_err(&drv->pdev->dev, "nci_recv_frame failed %d\n", rc);
return rc;
}
......@@ -414,13 +413,12 @@ static int nfcwilink_open(struct nci_dev *ndev)
goto clear_exit;
} else if (drv->st_register_cb_status != 0) {
rc = drv->st_register_cb_status;
nfc_dev_err(&drv->pdev->dev,
"st_register_cb failed %d", rc);
nfc_err(&drv->pdev->dev,
"st_register_cb failed %d\n", rc);
goto clear_exit;
}
} else {
nfc_dev_err(&drv->pdev->dev,
"st_register failed %d", rc);
nfc_err(&drv->pdev->dev, "st_register failed %d\n", rc);
goto clear_exit;
}
}
......@@ -430,8 +428,8 @@ static int nfcwilink_open(struct nci_dev *ndev)
drv->st_write = nfcwilink_proto.write;
if (nfcwilink_download_fw(drv)) {
nfc_dev_err(&drv->pdev->dev, "nfcwilink_download_fw failed %d",
rc);
nfc_err(&drv->pdev->dev, "nfcwilink_download_fw failed %d\n",
rc);
/* open should succeed, even if the FW download failed */
}
......@@ -454,7 +452,7 @@ static int nfcwilink_close(struct nci_dev *ndev)
rc = st_unregister(&nfcwilink_proto);
if (rc)
nfc_dev_err(&drv->pdev->dev, "st_unregister failed %d", rc);
nfc_err(&drv->pdev->dev, "st_unregister failed %d\n", rc);
drv->st_write = NULL;
......@@ -485,7 +483,7 @@ static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb)
len = drv->st_write(skb);
if (len < 0) {
kfree_skb(skb);
nfc_dev_err(&drv->pdev->dev, "st_write failed %ld", len);
nfc_err(&drv->pdev->dev, "st_write failed %ld\n", len);
return -EFAULT;
}
......@@ -523,7 +521,7 @@ static int nfcwilink_probe(struct platform_device *pdev)
NFCWILINK_HDR_LEN,
0);
if (!drv->ndev) {
nfc_dev_err(&pdev->dev, "nci_allocate_device failed");
nfc_err(&pdev->dev, "nci_allocate_device failed\n");
rc = -ENOMEM;
goto exit;
}
......@@ -533,7 +531,7 @@ static int nfcwilink_probe(struct platform_device *pdev)
rc = nci_register_device(drv->ndev);
if (rc < 0) {
nfc_dev_err(&pdev->dev, "nci_register_device failed %d", rc);
nfc_err(&pdev->dev, "nci_register_device failed %d\n", rc);
goto free_dev_exit;
}
......
This diff is collapsed.
......@@ -28,8 +28,8 @@
#include <linux/device.h>
#include <linux/skbuff.h>
#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_info(dev, fmt, ...) dev_info((dev), "NFC: " fmt, ##__VA_ARGS__)
#define nfc_err(dev, fmt, ...) dev_err((dev), "NFC: " fmt, ##__VA_ARGS__)
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