NFC: Add fix for CTS issue of IPC log file creation failed

Checking IPC log handle during usage rather than after creation.
This is because IPC logging is not available with boot image of
of GKI.

Change-Id: I81f4d5910bf721fd94f5858a2b7aba675a7be931
Signed-off-by: Karthik Poosa <[email protected]>
This commit is contained in:
Karthik Poosa 2020-10-30 13:44:53 +05:30
commit 33d50bb739

View file

@ -294,14 +294,6 @@ int nfc_misc_probe(struct nfc_dev *nfc_dev,
nfc_dev->ipcl = ipc_log_context_create(NUM_OF_IPC_LOG_PAGES,
dev_name(nfc_dev->nfc_device), 0);
if (!nfc_dev->ipcl) {
pr_err("nfc ipc log create failed\n");
device_destroy(nfc_dev->nfc_class, nfc_dev->devno);
cdev_del(&nfc_dev->c_dev);
class_destroy(nfc_dev->nfc_class);
unregister_chrdev_region(nfc_dev->devno, count);
return -ENXIO;
}
nfc_dev->kbuflen = MAX_BUFFER_SIZE;
nfc_dev->kbuf = kzalloc(MAX_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);