From 1b18025150035b7a193dbb6fe03b95a64643f12c Mon Sep 17 00:00:00 2001 From: Amir Samuelov Date: Tue, 16 Aug 2016 15:00:32 +0300 Subject: [PATCH] spcom: avoid false error message on spcom_device_release() Typically, spcom device nodes are associated with a glink channel. However, /dev/spcom and /dev/sp_ssr have other purposes, and they are not associated with a channel. Avoid error message when user call file close() for /dev/spcom and /dev/sp_ssr. Change-Id: I5dd55ad3c7ff93efb2e332fcab49b58cbc177c90 Signed-off-by: Amir Samuelov --- drivers/soc/qcom/spcom.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/spcom.c b/drivers/soc/qcom/spcom.c index 45af4b601634..30eff96fc27d 100644 --- a/drivers/soc/qcom/spcom.c +++ b/drivers/soc/qcom/spcom.c @@ -1920,10 +1920,20 @@ static int spcom_device_release(struct inode *inode, struct file *filp) pr_debug("Close file [%s].\n", name); + if (strcmp(name, DEVICE_NAME) == 0) { + pr_debug("root dir skipped.\n"); + return 0; + } + + if (strcmp(name, "sp_ssr") == 0) { + pr_debug("sp_ssr dev node skipped.\n"); + return 0; + } + ch = filp->private_data; if (!ch) { - pr_err("ch is NULL, file name %s.\n", file_to_filename(filp)); + pr_debug("ch is NULL, file name %s.\n", file_to_filename(filp)); return -ENODEV; }