From: Dmitry Torokhov Date: Mon, 22 Oct 2012 00:57:19 +0000 (-0700) Subject: char_dev: pin parent kobject X-Git-Tag: v3.7-rc3~53 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f0157f13f42800aa3d9017ebb0fb80a65f7b2de;p=pandora-kernel.git char_dev: pin parent kobject In certain cases (for example when a cdev structure is embedded into another object whose lifetime is controlled by a separate kobject) it is beneficial to tie lifetime of another object to the lifetime of character device so that related object is not freed until after char_dev object is freed. To achieve this let's pin kobject's parent when doing cdev_add() and unpin when last reference to cdev structure is being released. Signed-off-by: Dmitry Torokhov Acked-by: Al Viro Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed