[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)
commitddbf7d5a698c4d8553ad2f77cb281d7b37898d34
tree19a3fee248db10dea9c2eadaf9b3e4d1ca6714aa
parent8f3408d5a14f3a50253d9e8fd4c443af4af8fa3f
[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