]> git.baikalelectronics.ru Git - kernel.git/commit
media: cec: ensure that adap_enable(false) is called from cec_delete_adapter()
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 20 Aug 2017 11:41:41 +0000 (07:41 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 26 Aug 2017 12:32:15 +0000 (08:32 -0400)
commite9fba380296d145dac6d030bb1c63ae2323bce88
tree5c47d7c13ae95619ed485f816b7bea70d3183c4d
parent6730260f010d8ed041263f156eaf45d375f7b157
media: cec: ensure that adap_enable(false) is called from cec_delete_adapter()

When the adapter is removed the cec_delete_adapter() call attempts
to set the physical address to INVALID by calling __cec_s_phys_addr()
and so disabling the adapter.

However, __cec_s_phys_addr checks if the device node was unregistered
and just returns in that case.

This means that the adap_enable callback is never called with 'false'
to disable the CEC adapter. Most drivers don't care, but some need
to do cleanup here.

Change the test so the adapter is correctly disabled, even when the
device node is unregistered.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/cec/cec-adap.c