Thread (7 messages) 7 messages, 2 authors, 2020-03-02

Re: [RFC PATCH v4 1/2] devres: Provide new helper for devm functions

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2020-02-27 13:28:51
Also in: linux-clk, lkml

Hi Marc,

On Wed, Feb 26, 2020 at 4:55 PM Marc Gonzalez [off-list ref] wrote:
Provide a simple wrapper for devres_alloc / devres_add.

Signed-off-by: Marc Gonzalez <redacted>
With the grammar fixed, as per below:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
quoted hunk ↗ jump to hunk
--- 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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help