diff mbox

[v2,1/3] drivers: of: add return value to of_reserved_mem_device_init (fixup)

Message ID 1411713865-26192-1-git-send-email-m.szyprowski@samsung.com
State New
Headers show

Commit Message

Marek Szyprowski Sept. 26, 2014, 6:44 a.m. UTC
This patch adds missing return value to error paths.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/of/of_reserved_mem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Fabio Estevam Sept. 27, 2014, 1:58 p.m. UTC | #1
Hi Marek,

On Fri, Sep 26, 2014 at 3:44 AM, Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> This patch adds missing return value to error paths.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

I have also sent a similar fix:
http://www.spinics.net/lists/devicetree/msg51127.html

> ---
>  drivers/of/of_reserved_mem.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
> index 7e7de03..e975156 100644
> --- a/drivers/of/of_reserved_mem.c
> +++ b/drivers/of/of_reserved_mem.c
> @@ -250,13 +250,13 @@ int of_reserved_mem_device_init(struct device *dev)
>
>         np = of_parse_phandle(dev->of_node, "memory-region", 0);
>         if (!np)
> -               return;
> +               return -ENODEV;
>
>         rmem = __find_rmem(np);
>         of_node_put(np);
>
>         if (!rmem || !rmem->ops || !rmem->ops->device_init)
> -               return;
> +               return -ENIVAL;

ENIVAL does not exist. I guess you meant EINVAL ;-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 7e7de03..e975156 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -250,13 +250,13 @@  int of_reserved_mem_device_init(struct device *dev)
 
 	np = of_parse_phandle(dev->of_node, "memory-region", 0);
 	if (!np)
-		return;
+		return -ENODEV;
 
 	rmem = __find_rmem(np);
 	of_node_put(np);
 
 	if (!rmem || !rmem->ops || !rmem->ops->device_init)
-		return;
+		return -ENIVAL;
 
 	rmem->ops->device_init(rmem, dev);
 	dev_info(dev, "assigned reserved memory node %s\n", rmem->name);