From: Philipp Zabel Date: Mon, 29 Apr 2013 23:17:10 +0000 (-0700) Subject: genalloc: add devres support, allow to find a managed pool by device X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~123^2~283 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9375db07adeaeea5f5ea7ca0463a8b371d71ddbb;p=pandora-kernel.git genalloc: add devres support, allow to find a managed pool by device This patch adds three exported functions to lib/genalloc.c: devm_gen_pool_create, dev_get_gen_pool, and of_get_named_gen_pool. devm_gen_pool_create is a managed version of gen_pool_create that keeps track of the pool via devres and allows the management code to automatically destroy it after device removal. dev_get_gen_pool retrieves the gen_pool for a given device, if it was created with devm_gen_pool_create, using devres_find. of_get_named_gen_pool retrieves the gen_pool for a given device node and property name, where the property must contain a phandle pointing to a platform device node. The corresponding platform device is then fed into dev_get_gen_pool and the resulting gen_pool is returned. [akpm@linux-foundation.org: make the of_get_named_gen_pool() stub static, fixing a zillion link errors] [akpm@linux-foundation.org: squish "struct device declared inside parameter list" warning] Signed-off-by: Philipp Zabel Acked-by: Grant Likely Tested-by: Michal Simek Cc: Fabio Estevam Cc: Matt Porter Cc: Dong Aisheng Cc: Greg Kroah-Hartman Cc: Rob Herring Cc: Paul Gortmaker Cc: Javier Martin Cc: Huang Shijie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed