aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/cec/core/cec-core.c
diff options
context:
space:
mode:
authorHans Verkuil <[email protected]>2022-03-17 08:51:20 +0000
committerMauro Carvalho Chehab <[email protected]>2022-04-24 06:40:42 +0000
commite2ed5024ac2bc27d4bfc99fd58f5ab54de8fa965 (patch)
treecbf06cf9cdc0b39160ff83a0e4b48af9582989f4 /drivers/media/cec/core/cec-core.c
parentmedia: cec.h: add cec_msg_recv_is_rx/tx_result helpers (diff)
downloadkernel-e2ed5024ac2bc27d4bfc99fd58f5ab54de8fa965.tar.gz
kernel-e2ed5024ac2bc27d4bfc99fd58f5ab54de8fa965.zip
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
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)