NFC: digital: Add newline to pr_* calls
We do not add the newline to the pr_fmt macro, in order to give more flexibility to the caller and to keep the logging style consistent with the rest of the NFC and kernel code. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
c5da0e4a35
commit
260425308d
|
@ -198,14 +198,14 @@ static void digital_wq_cmd(struct work_struct *work)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
pr_err("Unknown cmd type %d", cmd->type);
|
pr_err("Unknown cmd type %d\n", cmd->type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rc)
|
if (!rc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pr_err("in_send_command returned err %d", rc);
|
pr_err("in_send_command returned err %d\n", rc);
|
||||||
|
|
||||||
mutex_lock(&ddev->cmd_lock);
|
mutex_lock(&ddev->cmd_lock);
|
||||||
list_del(&cmd->queue);
|
list_del(&cmd->queue);
|
||||||
|
@ -252,7 +252,7 @@ int digital_in_configure_hw(struct nfc_digital_dev *ddev, int type, int param)
|
||||||
|
|
||||||
rc = ddev->ops->in_configure_hw(ddev, type, param);
|
rc = ddev->ops->in_configure_hw(ddev, type, param);
|
||||||
if (rc)
|
if (rc)
|
||||||
pr_err("in_configure_hw failed: %d", rc);
|
pr_err("in_configure_hw failed: %d\n", rc);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ int digital_tg_configure_hw(struct nfc_digital_dev *ddev, int type, int param)
|
||||||
|
|
||||||
rc = ddev->ops->tg_configure_hw(ddev, type, param);
|
rc = ddev->ops->tg_configure_hw(ddev, type, param);
|
||||||
if (rc)
|
if (rc)
|
||||||
pr_err("tg_configure_hw failed: %d", rc);
|
pr_err("tg_configure_hw failed: %d\n", rc);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -332,11 +332,11 @@ int digital_target_found(struct nfc_digital_dev *ddev,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
pr_err("Invalid protocol %d", protocol);
|
pr_err("Invalid protocol %d\n", protocol);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_debug("rf_tech=%d, protocol=%d", rf_tech, protocol);
|
pr_debug("rf_tech=%d, protocol=%d\n", rf_tech, protocol);
|
||||||
|
|
||||||
ddev->curr_rf_tech = rf_tech;
|
ddev->curr_rf_tech = rf_tech;
|
||||||
ddev->curr_protocol = protocol;
|
ddev->curr_protocol = protocol;
|
||||||
|
@ -434,24 +434,24 @@ static int digital_start_poll(struct nfc_dev *nfc_dev, __u32 im_protocols,
|
||||||
struct nfc_digital_dev *ddev = nfc_get_drvdata(nfc_dev);
|
struct nfc_digital_dev *ddev = nfc_get_drvdata(nfc_dev);
|
||||||
u32 matching_im_protocols, matching_tm_protocols;
|
u32 matching_im_protocols, matching_tm_protocols;
|
||||||
|
|
||||||
pr_debug("protocols: im 0x%x, tm 0x%x, supported 0x%x", im_protocols,
|
pr_debug("protocols: im 0x%x, tm 0x%x, supported 0x%x\n", im_protocols,
|
||||||
tm_protocols, ddev->protocols);
|
tm_protocols, ddev->protocols);
|
||||||
|
|
||||||
matching_im_protocols = ddev->protocols & im_protocols;
|
matching_im_protocols = ddev->protocols & im_protocols;
|
||||||
matching_tm_protocols = ddev->protocols & tm_protocols;
|
matching_tm_protocols = ddev->protocols & tm_protocols;
|
||||||
|
|
||||||
if (!matching_im_protocols && !matching_tm_protocols) {
|
if (!matching_im_protocols && !matching_tm_protocols) {
|
||||||
pr_err("No known protocol");
|
pr_err("Unknown protocol\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ddev->poll_tech_count) {
|
if (ddev->poll_tech_count) {
|
||||||
pr_err("Already polling");
|
pr_err("Already polling\n");
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ddev->curr_protocol) {
|
if (ddev->curr_protocol) {
|
||||||
pr_err("A target is already active");
|
pr_err("A target is already active\n");
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,7 +487,7 @@ static int digital_start_poll(struct nfc_dev *nfc_dev, __u32 im_protocols,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ddev->poll_tech_count) {
|
if (!ddev->poll_tech_count) {
|
||||||
pr_err("Unsupported protocols: im=0x%x, tm=0x%x",
|
pr_err("Unsupported protocols: im=0x%x, tm=0x%x\n",
|
||||||
matching_im_protocols, matching_tm_protocols);
|
matching_im_protocols, matching_tm_protocols);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -504,7 +504,7 @@ static void digital_stop_poll(struct nfc_dev *nfc_dev)
|
||||||
mutex_lock(&ddev->poll_lock);
|
mutex_lock(&ddev->poll_lock);
|
||||||
|
|
||||||
if (!ddev->poll_tech_count) {
|
if (!ddev->poll_tech_count) {
|
||||||
pr_err("Polling operation was not running");
|
pr_err("Polling operation was not running\n");
|
||||||
mutex_unlock(&ddev->poll_lock);
|
mutex_unlock(&ddev->poll_lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -611,7 +611,7 @@ static int digital_in_send(struct nfc_dev *nfc_dev, struct nfc_target *target,
|
||||||
|
|
||||||
data_exch = kzalloc(sizeof(struct digital_data_exch), GFP_KERNEL);
|
data_exch = kzalloc(sizeof(struct digital_data_exch), GFP_KERNEL);
|
||||||
if (!data_exch) {
|
if (!data_exch) {
|
||||||
pr_err("Failed to allocate data_exch struct");
|
pr_err("Failed to allocate data_exch struct\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,10 +653,8 @@ struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops,
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ddev = kzalloc(sizeof(struct nfc_digital_dev), GFP_KERNEL);
|
ddev = kzalloc(sizeof(struct nfc_digital_dev), GFP_KERNEL);
|
||||||
if (!ddev) {
|
if (!ddev)
|
||||||
pr_err("kzalloc failed");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
ddev->driver_capabilities = driver_capabilities;
|
ddev->driver_capabilities = driver_capabilities;
|
||||||
ddev->ops = ops;
|
ddev->ops = ops;
|
||||||
|
@ -686,7 +684,7 @@ struct nfc_digital_dev *nfc_digital_allocate_device(struct nfc_digital_ops *ops,
|
||||||
ddev->tx_headroom,
|
ddev->tx_headroom,
|
||||||
ddev->tx_tailroom);
|
ddev->tx_tailroom);
|
||||||
if (!ddev->nfc_dev) {
|
if (!ddev->nfc_dev) {
|
||||||
pr_err("nfc_allocate_device failed");
|
pr_err("nfc_allocate_device failed\n");
|
||||||
goto free_dev;
|
goto free_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,7 @@ static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
|
case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
|
||||||
pr_err("Received a ACK/NACK PDU");
|
pr_err("Received a ACK/NACK PDU\n");
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DIGITAL_NFC_DEP_MI_BIT_SET(pfb)) {
|
if (DIGITAL_NFC_DEP_MI_BIT_SET(pfb)) {
|
||||||
pr_err("MI bit set. Chained PDU not supported.");
|
pr_err("MI bit set. Chained PDU not supported\n");
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -426,16 +426,16 @@ static void digital_tg_recv_dep_req(struct nfc_digital_dev *ddev, void *arg,
|
||||||
|
|
||||||
switch (DIGITAL_NFC_DEP_PFB_TYPE(dep_req->pfb)) {
|
switch (DIGITAL_NFC_DEP_PFB_TYPE(dep_req->pfb)) {
|
||||||
case DIGITAL_NFC_DEP_PFB_I_PDU:
|
case DIGITAL_NFC_DEP_PFB_I_PDU:
|
||||||
pr_debug("DIGITAL_NFC_DEP_PFB_I_PDU");
|
pr_debug("DIGITAL_NFC_DEP_PFB_I_PDU\n");
|
||||||
ddev->curr_nfc_dep_pni = DIGITAL_NFC_DEP_PFB_PNI(dep_req->pfb);
|
ddev->curr_nfc_dep_pni = DIGITAL_NFC_DEP_PFB_PNI(dep_req->pfb);
|
||||||
break;
|
break;
|
||||||
case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
|
case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU:
|
||||||
pr_err("Received a ACK/NACK PDU");
|
pr_err("Received a ACK/NACK PDU\n");
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
goto exit;
|
goto exit;
|
||||||
break;
|
break;
|
||||||
case DIGITAL_NFC_DEP_PFB_SUPERVISOR_PDU:
|
case DIGITAL_NFC_DEP_PFB_SUPERVISOR_PDU:
|
||||||
pr_err("Received a SUPERVISOR PDU");
|
pr_err("Received a SUPERVISOR PDU\n");
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
goto exit;
|
goto exit;
|
||||||
break;
|
break;
|
||||||
|
@ -563,7 +563,7 @@ static void digital_tg_recv_psl_req(struct nfc_digital_dev *ddev, void *arg,
|
||||||
rf_tech = NFC_DIGITAL_RF_TECH_424F;
|
rf_tech = NFC_DIGITAL_RF_TECH_424F;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pr_err("Unsuported dsi value %d", dsi);
|
pr_err("Unsuported dsi value %d\n", dsi);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -259,10 +259,8 @@ static int digital_in_send_sdd_req(struct nfc_digital_dev *ddev,
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
skb = digital_skb_alloc(ddev, 2);
|
skb = digital_skb_alloc(ddev, 2);
|
||||||
if (!skb) {
|
if (!skb)
|
||||||
pr_err("alloc_skb failed");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
if (target->nfcid1_len == 0)
|
if (target->nfcid1_len == 0)
|
||||||
sel_cmd = DIGITAL_CMD_SEL_REQ_CL1;
|
sel_cmd = DIGITAL_CMD_SEL_REQ_CL1;
|
||||||
|
|
Loading…
Reference in New Issue