]> git.baikalelectronics.ru Git - kernel.git/commit
[media] rc: core: add managed versions of rc_allocate_device and rc_register_device
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 30 Sep 2016 20:42:07 +0000 (17:42 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 24 Oct 2016 20:28:56 +0000 (18:28 -0200)
commit3ec1c569bfa840ca6325fc06246ee7c5285b204f
tree19a3fee248db10dea9c2eadaf9b3e4d1ca6714aa
parent015de6f7f53dc6f42cdeff82f56c392257f8e450
[media] rc: core: add managed versions of rc_allocate_device and rc_register_device

Introduce managed versions of both functions.
They allows to simplify the error path in the probe function of
rc drivers, and usually also to simplify the remove function.

New element managed_alloc in struct rc_dev is needed to correctly
handle mixed use, e.g. managed version of rc_register_device and
normal version of rc_allocate_device.

In addition devm_rc_allocate_device sets rc->dev.parent as having a
reference to the parent device might be useful for future extensions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/rc-main.c
include/media/rc-core.h