]> git.baikalelectronics.ru Git - kernel.git/commit
component: add support for releasing match data
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 17 Nov 2015 12:08:01 +0000 (12:08 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 7 Dec 2015 00:02:05 +0000 (00:02 +0000)
commit1d4a68ac58340f5705cdf582344c0846648aee4f
treec21cbca7e01935dc303b6dd7bdfb4f67ecc4ea47
parentd2d67e5dee2b5afded2665f3a37211c13ab3efbd
component: add support for releasing match data

The component helper treats the void match data pointer as an opaque
object which needs no further management.  When device nodes being
passed, this is not true: the caller should pass its refcount to the
component helper, and there should be a way to drop the refcount when
the matching information is destroyed.

This patch provides a per-match release method in addition to the match
method to solve this issue.  Rather than using component_match_add(),
users should use component_match_add_release() which takes an additional
function pointer for releasing this reference.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/base/component.c
include/linux/component.h