diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2017-07-15 09:32:56 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-07-26 05:46:44 -0400 |
commit | fc1ff45a07abf240aa0c6586c11465c86c8cab8d (patch) | |
tree | 0eba84919fe75c472cb44ad97159f5c8b502190d /drivers/media/cec | |
parent | 9b7c0c476f66ee212925c801c4141fdd83b7336d (diff) | |
download | linux-fc1ff45a07abf240aa0c6586c11465c86c8cab8d.tar.gz linux-fc1ff45a07abf240aa0c6586c11465c86c8cab8d.tar.bz2 linux-fc1ff45a07abf240aa0c6586c11465c86c8cab8d.zip |
media: cec-notifier: small improvements
Allow calling cec_notifier_set_phys_addr and
cec_notifier_set_phys_addr_from_edid with a NULL notifier, in which
case these functions do nothing.
Add a cec_notifier_phys_addr_invalidate helper function (the notifier
equivalent of cec_phys_addr_invalidate).
These changes simplify drm CEC driver support.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/cec')
-rw-r--r-- | drivers/media/cec/cec-notifier.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/cec/cec-notifier.c b/drivers/media/cec/cec-notifier.c index 74dc1c32080e..08b619d0ea1e 100644 --- a/drivers/media/cec/cec-notifier.c +++ b/drivers/media/cec/cec-notifier.c @@ -87,6 +87,9 @@ EXPORT_SYMBOL_GPL(cec_notifier_put); void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa) { + if (n == NULL) + return; + mutex_lock(&n->lock); n->phys_addr = pa; if (n->callback) @@ -100,6 +103,9 @@ void cec_notifier_set_phys_addr_from_edid(struct cec_notifier *n, { u16 pa = CEC_PHYS_ADDR_INVALID; + if (n == NULL) + return; + if (edid && edid->extensions) pa = cec_get_edid_phys_addr((const u8 *)edid, EDID_LENGTH * (edid->extensions + 1), NULL); |