Skip to content

Commit b483483

Browse files
JoePerchesSamuel Ortiz
authored andcommitted
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: Joe Perches <joe@perches.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 3943826 commit b483483

File tree

4 files changed

+91
-122
lines changed

4 files changed

+91
-122
lines changed

drivers/nfc/nfcsim.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define DEV_ERR(_dev, fmt, args...) nfc_dev_err(&_dev->nfc_dev->dev, \
2323
"%s: " fmt, __func__, ## args)
2424

25-
#define DEV_DBG(_dev, fmt, args...) nfc_dev_dbg(&_dev->nfc_dev->dev, \
25+
#define DEV_DBG(_dev, fmt, args...) dev_dbg(&_dev->nfc_dev->dev, \
2626
"%s: " fmt, __func__, ## args)
2727

2828
#define NFCSIM_VERSION "0.1"
@@ -64,7 +64,7 @@ static struct workqueue_struct *wq;
6464

6565
static void nfcsim_cleanup_dev(struct nfcsim *dev, u8 shutdown)
6666
{
67-
DEV_DBG(dev, "shutdown=%d", shutdown);
67+
DEV_DBG(dev, "shutdown=%d\n", shutdown);
6868

6969
mutex_lock(&dev->lock);
7070

@@ -84,7 +84,7 @@ static int nfcsim_target_found(struct nfcsim *dev)
8484
{
8585
struct nfc_target nfc_tgt;
8686

87-
DEV_DBG(dev, "");
87+
DEV_DBG(dev, "\n");
8888

8989
memset(&nfc_tgt, 0, sizeof(struct nfc_target));
9090

@@ -98,7 +98,7 @@ static int nfcsim_dev_up(struct nfc_dev *nfc_dev)
9898
{
9999
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
100100

101-
DEV_DBG(dev, "");
101+
DEV_DBG(dev, "\n");
102102

103103
mutex_lock(&dev->lock);
104104

@@ -113,7 +113,7 @@ static int nfcsim_dev_down(struct nfc_dev *nfc_dev)
113113
{
114114
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
115115

116-
DEV_DBG(dev, "");
116+
DEV_DBG(dev, "\n");
117117

118118
mutex_lock(&dev->lock);
119119

@@ -172,7 +172,7 @@ static int nfcsim_dep_link_down(struct nfc_dev *nfc_dev)
172172
{
173173
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
174174

175-
DEV_DBG(dev, "");
175+
DEV_DBG(dev, "\n");
176176

177177
nfcsim_cleanup_dev(dev, 0);
178178

@@ -210,7 +210,7 @@ static int nfcsim_start_poll(struct nfc_dev *nfc_dev,
210210

211211
queue_delayed_work(wq, &dev->poll_work, 0);
212212

213-
DEV_DBG(dev, "Start polling: im: 0x%X, tm: 0x%X", im_protocols,
213+
DEV_DBG(dev, "Start polling: im: 0x%X, tm: 0x%X\n", im_protocols,
214214
tm_protocols);
215215

216216
rc = 0;
@@ -224,7 +224,7 @@ static void nfcsim_stop_poll(struct nfc_dev *nfc_dev)
224224
{
225225
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
226226

227-
DEV_DBG(dev, "Stop poll");
227+
DEV_DBG(dev, "Stop poll\n");
228228

229229
mutex_lock(&dev->lock);
230230

@@ -240,7 +240,7 @@ static int nfcsim_activate_target(struct nfc_dev *nfc_dev,
240240
{
241241
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
242242

243-
DEV_DBG(dev, "");
243+
DEV_DBG(dev, "\n");
244244

245245
return -ENOTSUPP;
246246
}
@@ -250,7 +250,7 @@ static void nfcsim_deactivate_target(struct nfc_dev *nfc_dev,
250250
{
251251
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
252252

253-
DEV_DBG(dev, "");
253+
DEV_DBG(dev, "\n");
254254
}
255255

256256
static void nfcsim_wq_recv(struct work_struct *work)
@@ -397,13 +397,13 @@ static void nfcsim_wq_poll(struct work_struct *work)
397397
nfcsim_set_polling_mode(dev);
398398

399399
if (dev->curr_polling_mode == NFCSIM_POLL_NONE) {
400-
DEV_DBG(dev, "Not polling");
400+
DEV_DBG(dev, "Not polling\n");
401401
goto unlock;
402402
}
403403

404404
DEV_DBG(dev, "Polling as %s",
405405
dev->curr_polling_mode == NFCSIM_POLL_INITIATOR ?
406-
"initiator" : "target");
406+
"initiator\n" : "target\n");
407407

408408
if (dev->curr_polling_mode == NFCSIM_POLL_TARGET)
409409
goto sched_work;

drivers/nfc/nfcwilink.c

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
146146
unsigned long comp_ret;
147147
int rc;
148148

149-
nfc_dev_dbg(&drv->pdev->dev, "get_bts_file_name entry");
150-
151149
skb = nfcwilink_skb_alloc(sizeof(struct nci_vs_nfcc_info_cmd),
152150
GFP_KERNEL);
153151
if (!skb) {
@@ -170,17 +168,16 @@ static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
170168

171169
comp_ret = wait_for_completion_timeout(&drv->completed,
172170
msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
173-
nfc_dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld",
174-
comp_ret);
171+
dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
172+
comp_ret);
175173
if (comp_ret == 0) {
176-
nfc_dev_err(&drv->pdev->dev,
177-
"timeout on wait_for_completion_timeout");
174+
dev_err(&drv->pdev->dev,
175+
"timeout on wait_for_completion_timeout\n");
178176
return -ETIMEDOUT;
179177
}
180178

181-
nfc_dev_dbg(&drv->pdev->dev, "nci_vs_nfcc_info_rsp: plen %d, status %d",
182-
drv->nfcc_info.plen,
183-
drv->nfcc_info.status);
179+
dev_dbg(&drv->pdev->dev, "nci_vs_nfcc_info_rsp: plen %d, status %d\n",
180+
drv->nfcc_info.plen, drv->nfcc_info.status);
184181

185182
if ((drv->nfcc_info.plen != 5) || (drv->nfcc_info.status != 0)) {
186183
nfc_dev_err(&drv->pdev->dev,
@@ -207,8 +204,6 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
207204
unsigned long comp_ret;
208205
int rc;
209206

210-
nfc_dev_dbg(&drv->pdev->dev, "send_bts_cmd entry");
211-
212207
/* verify valid cmd for the NFC channel */
213208
if ((len <= sizeof(struct nfcwilink_hdr)) ||
214209
(len > BTS_FILE_CMD_MAX_LEN) ||
@@ -238,8 +233,8 @@ static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
238233

239234
comp_ret = wait_for_completion_timeout(&drv->completed,
240235
msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
241-
nfc_dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld",
242-
comp_ret);
236+
dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
237+
comp_ret);
243238
if (comp_ret == 0) {
244239
nfc_dev_err(&drv->pdev->dev,
245240
"timeout on wait_for_completion_timeout");
@@ -257,8 +252,6 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
257252
__u8 *ptr;
258253
int len, rc;
259254

260-
nfc_dev_dbg(&drv->pdev->dev, "download_fw entry");
261-
262255
set_bit(NFCWILINK_FW_DOWNLOAD, &drv->flags);
263256

264257
rc = nfcwilink_get_bts_file_name(drv, file_name);
@@ -280,8 +273,8 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
280273
ptr = (__u8 *)fw->data;
281274

282275
if ((len == 0) || (ptr == NULL)) {
283-
nfc_dev_dbg(&drv->pdev->dev,
284-
"request_firmware returned size %d", len);
276+
dev_dbg(&drv->pdev->dev,
277+
"request_firmware returned size %d\n", len);
285278
goto release_fw;
286279
}
287280

@@ -302,8 +295,8 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
302295
action_len =
303296
__le16_to_cpu(((struct bts_file_action *)ptr)->len);
304297

305-
nfc_dev_dbg(&drv->pdev->dev, "bts_file_action type %d, len %d",
306-
action_type, action_len);
298+
dev_dbg(&drv->pdev->dev, "bts_file_action type %d, len %d\n",
299+
action_type, action_len);
307300

308301
switch (action_type) {
309302
case BTS_FILE_ACTION_TYPE_SEND_CMD:
@@ -333,8 +326,6 @@ static void nfcwilink_register_complete(void *priv_data, char data)
333326
{
334327
struct nfcwilink *drv = priv_data;
335328

336-
nfc_dev_dbg(&drv->pdev->dev, "register_complete entry");
337-
338329
/* store ST registration status */
339330
drv->st_register_cb_status = data;
340331

@@ -356,7 +347,7 @@ static long nfcwilink_receive(void *priv_data, struct sk_buff *skb)
356347
return -EFAULT;
357348
}
358349

359-
nfc_dev_dbg(&drv->pdev->dev, "receive entry, len %d", skb->len);
350+
dev_dbg(&drv->pdev->dev, "receive entry, len %d\n", skb->len);
360351

361352
/* strip the ST header
362353
(apart for the chnl byte, which is not received in the hdr) */
@@ -396,8 +387,6 @@ static int nfcwilink_open(struct nci_dev *ndev)
396387
unsigned long comp_ret;
397388
int rc;
398389

399-
nfc_dev_dbg(&drv->pdev->dev, "open entry");
400-
401390
if (test_and_set_bit(NFCWILINK_RUNNING, &drv->flags)) {
402391
rc = -EBUSY;
403392
goto exit;
@@ -415,9 +404,9 @@ static int nfcwilink_open(struct nci_dev *ndev)
415404
&drv->completed,
416405
msecs_to_jiffies(NFCWILINK_REGISTER_TIMEOUT));
417406

418-
nfc_dev_dbg(&drv->pdev->dev,
419-
"wait_for_completion_timeout returned %ld",
420-
comp_ret);
407+
dev_dbg(&drv->pdev->dev,
408+
"wait_for_completion_timeout returned %ld\n",
409+
comp_ret);
421410

422411
if (comp_ret == 0) {
423412
/* timeout */
@@ -460,8 +449,6 @@ static int nfcwilink_close(struct nci_dev *ndev)
460449
struct nfcwilink *drv = nci_get_drvdata(ndev);
461450
int rc;
462451

463-
nfc_dev_dbg(&drv->pdev->dev, "close entry");
464-
465452
if (!test_and_clear_bit(NFCWILINK_RUNNING, &drv->flags))
466453
return 0;
467454

@@ -480,7 +467,7 @@ static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb)
480467
struct nfcwilink_hdr hdr = {NFCWILINK_CHNL, NFCWILINK_OPCODE, 0x0000};
481468
long len;
482469

483-
nfc_dev_dbg(&drv->pdev->dev, "send entry, len %d", skb->len);
470+
dev_dbg(&drv->pdev->dev, "send entry, len %d\n", skb->len);
484471

485472
if (!test_bit(NFCWILINK_RUNNING, &drv->flags)) {
486473
kfree_skb(skb);
@@ -517,8 +504,6 @@ static int nfcwilink_probe(struct platform_device *pdev)
517504
int rc;
518505
__u32 protocols;
519506

520-
nfc_dev_dbg(&pdev->dev, "probe entry");
521-
522507
drv = devm_kzalloc(&pdev->dev, sizeof(struct nfcwilink), GFP_KERNEL);
523508
if (!drv) {
524509
rc = -ENOMEM;
@@ -568,8 +553,6 @@ static int nfcwilink_remove(struct platform_device *pdev)
568553
struct nfcwilink *drv = dev_get_drvdata(&pdev->dev);
569554
struct nci_dev *ndev;
570555

571-
nfc_dev_dbg(&pdev->dev, "remove entry");
572-
573556
if (!drv)
574557
return -EFAULT;
575558

0 commit comments

Comments
 (0)