lkml.org 
[lkml]   [2020]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH v4 1/2] devres: Provide new helper for devm functions
Hi Marc,

On Wed, Feb 26, 2020 at 4:55 PM Marc Gonzalez <marc.w.gonzalez@free.fr> wrote:
> Provide a simple wrapper for devres_alloc / devres_add.
>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>

With the grammar fixed, as per below:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/base/devres.c
> +++ b/drivers/base/devres.c
> @@ -685,6 +685,34 @@ int devres_release_group(struct device *dev, void *id)
> }
> EXPORT_SYMBOL_GPL(devres_release_group);
>
> +/**
> + * devm_add - allocate and register new device resource
> + * @dev: device to add resource to
> + * @func: resource release function
> + * @arg: resource data
> + * @size: resource data size
> + *
> + * Simple wrapper for devres_alloc / devres_add.
> + * Release the resource if the allocation fails.

Releases ... failed.

> + *
> + * RETURNS:
> + * 0 if the allocation succeeds, -ENOMEM otherwise.

"0 on success" would avoid any discussion about "succeeds" or "succeeded" ;-)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

\
 
 \ /
  Last update: 2020-02-27 14:29    [W:0.062 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site