mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
configfs: Introduce config_item_get_unless_zero()
Signed-off-by: Bart Van Assche <[email protected]> [hch: minor style tweak] Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
ba80aa909c
commit
19e72d3abb
2 changed files with 10 additions and 1 deletions
|
|
@ -138,6 +138,14 @@ struct config_item *config_item_get(struct config_item *item)
|
|||
}
|
||||
EXPORT_SYMBOL(config_item_get);
|
||||
|
||||
struct config_item *config_item_get_unless_zero(struct config_item *item)
|
||||
{
|
||||
if (item && kref_get_unless_zero(&item->ci_kref))
|
||||
return item;
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(config_item_get_unless_zero);
|
||||
|
||||
static void config_item_cleanup(struct config_item *item)
|
||||
{
|
||||
struct config_item_type *t = item->ci_type;
|
||||
|
|
|
|||
Loading…
Reference in a new issue