summaryrefslogtreecommitdiffstats
path: root/drivers/media/cec/core/cec-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2022-03-17 08:51:20 +0000
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-04-24 07:40:42 +0100
commite2ed5024ac2bc27d4bfc99fd58f5ab54de8fa965 (patch)
treecbf06cf9cdc0b39160ff83a0e4b48af9582989f4 /drivers/media/cec/core/cec-core.c
parent567f882a401346779d05a90beb8f21865ebdd398 (diff)
downloadlinux-e2ed5024ac2bc27d4bfc99fd58f5ab54de8fa965.tar.bz2
media: cec: use call_op and check for !unregistered
Use call_(void_)op consistently in the CEC core framework. Ditto for the cec pin ops. And check if !adap->devnode.unregistered before calling each op. This avoids calls to ops when the device has been unregistered and the underlying hardware may be gone. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/cec/core/cec-core.c')
-rw-r--r--drivers/media/cec/core/cec-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c
index a3ab6a43fb14..6038be40b448 100644
--- a/drivers/media/cec/core/cec-core.c
+++ b/drivers/media/cec/core/cec-core.c
@@ -204,7 +204,7 @@ static ssize_t cec_error_inj_write(struct file *file,
line = strsep(&p, "\n");
if (!*line || *line == '#')
continue;
- if (!adap->ops->error_inj_parse_line(adap, line)) {
+ if (!call_op(adap, error_inj_parse_line, line)) {
kfree(buf);
return -EINVAL;
}
@@ -217,7 +217,7 @@ static int cec_error_inj_show(struct seq_file *sf, void *unused)
{
struct cec_adapter *adap = sf->private;
- return adap->ops->error_inj_show(adap, sf);
+ return call_op(adap, error_inj_show, sf);
}
static int cec_error_inj_open(struct inode *inode, struct file *file)