rtc: dev: properly manage lifetime of dev and cdev in rtc device
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 20 Jul 2015 23:02:51 +0000 (16:02 -0700)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 5 Sep 2015 11:19:07 +0000 (13:19 +0200)
commit1e4cd62558c293bc51cc179d676b708683a29c12
treeecb6dc749be74b387877b177fa74cf03569197d4
parentc3b399a4b6703a04ef6eb3efe35ff12163e409e0
rtc: dev: properly manage lifetime of dev and cdev in rtc device

struct rtc embeds both struct dev and struct cdev.  Unfortunately character
device structure may outlive the parent rtc structure unless we set it up
as parent of character device so that it will stay pinned until character
device is freed.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-dev.c