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