Skip to content

Commit abdd4a7

Browse files
Vladimir Zapolskiytorvalds
authored andcommitted
genalloc: rename of_get_named_gen_pool() to of_gen_pool_get()
To be consistent with other kernel interface namings, rename of_get_named_gen_pool() to of_gen_pool_get(). In the original function name "_named" suffix references to a device tree property, which contains a phandle to a device and the corresponding device driver is assumed to register a gen_pool object. Due to a weak relation and to avoid any confusion (e.g. in future possible scenario if gen_pool objects are named) the suffix is removed. [sfr@canb.auug.org.au: crypto/marvell/cesa - fix up for of_get_named_gen_pool() rename] Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Takashi Iwai <tiwai@suse.de> Cc: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0030edf commit abdd4a7

6 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎drivers/crypto/marvell/cesa.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,8 @@ static int mv_cesa_get_sram(struct platform_device *pdev, int idx)
321321
const char *res_name = "sram";
322322
struct resource *res;
323323

324-
engine->pool = of_get_named_gen_pool(cesa->dev->of_node,
325-
"marvell,crypto-srams",
326-
idx);
324+
engine->pool = of_gen_pool_get(cesa->dev->of_node,
325+
"marvell,crypto-srams", idx);
327326
if (engine->pool) {
328327
engine->sram = gen_pool_dma_alloc(engine->pool,
329328
cesa->sram_size,

‎drivers/dma/mmp_tdma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
657657
INIT_LIST_HEAD(&tdev->device.channels);
658658

659659
if (pdev->dev.of_node)
660-
pool = of_get_named_gen_pool(pdev->dev.of_node, "asram", 0);
660+
pool = of_gen_pool_get(pdev->dev.of_node, "asram", 0);
661661
else
662662
pool = sram_get_gpool("asram");
663663
if (!pool) {

‎drivers/media/platform/coda/coda-common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ static int coda_probe(struct platform_device *pdev)
21552155
}
21562156

21572157
/* Get IRAM pool from device tree or platform data */
2158-
pool = of_get_named_gen_pool(np, "iram", 0);
2158+
pool = of_gen_pool_get(np, "iram", 0);
21592159
if (!pool && pdata)
21602160
pool = gen_pool_get(pdata->iram_dev);
21612161
if (!pool) {

‎include/linux/genalloc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
125125
size_t size);
126126

127127
#ifdef CONFIG_OF
128-
extern struct gen_pool *of_get_named_gen_pool(struct device_node *np,
128+
extern struct gen_pool *of_gen_pool_get(struct device_node *np,
129129
const char *propname, int index);
130130
#else
131-
static inline struct gen_pool *of_get_named_gen_pool(struct device_node *np,
131+
static inline struct gen_pool *of_gen_pool_get(struct device_node *np,
132132
const char *propname, int index)
133133
{
134134
return NULL;

‎lib/genalloc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ EXPORT_SYMBOL_GPL(gen_pool_get);
620620

621621
#ifdef CONFIG_OF
622622
/**
623-
* of_get_named_gen_pool - find a pool by phandle property
623+
* of_gen_pool_get - find a pool by phandle property
624624
* @np: device node
625625
* @propname: property name containing phandle(s)
626626
* @index: index into the phandle array
@@ -629,7 +629,7 @@ EXPORT_SYMBOL_GPL(gen_pool_get);
629629
* address of the device tree node pointed at by the phandle property,
630630
* or NULL if not found.
631631
*/
632-
struct gen_pool *of_get_named_gen_pool(struct device_node *np,
632+
struct gen_pool *of_gen_pool_get(struct device_node *np,
633633
const char *propname, int index)
634634
{
635635
struct platform_device *pdev;
@@ -644,5 +644,5 @@ struct gen_pool *of_get_named_gen_pool(struct device_node *np,
644644
return NULL;
645645
return gen_pool_get(&pdev->dev);
646646
}
647-
EXPORT_SYMBOL_GPL(of_get_named_gen_pool);
647+
EXPORT_SYMBOL_GPL(of_gen_pool_get);
648648
#endif /* CONFIG_OF */

‎sound/core/memalloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size)
124124
dmab->addr = 0;
125125

126126
if (dev->of_node)
127-
pool = of_get_named_gen_pool(dev->of_node, "iram", 0);
127+
pool = of_gen_pool_get(dev->of_node, "iram", 0);
128128

129129
if (!pool)
130130
return;

0 commit comments

Comments
 (0)