mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mfd: syscon: Include linux/err.h to fix build error
@ 2014-05-09 11:07 Tushar Behera
  2014-05-09 11:15 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Tushar Behera @ 2014-05-09 11:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, peter.chen

commit df73de9b0d412 ("mfd: syscon: Return -ENOSYS if CONFIG_MFD_SYSCON
is not enabled") introduced fallbacks for APIs, but missed out on adding
the header file. This would work only if linux/err.h is also included
in the source code from where this file is included. It would be better
to include linux/err.h in file to remove possible build errors.

Without this patch, we get following and similar build errors if this
header file is included in some source file and CONFIG_MFD_SYSCON is
not enabled.

include/linux/mfd/syscon.h: In function ‘syscon_node_to_regmap’:
include/linux/mfd/syscon.h:30:2: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration]
  return ERR_PTR(-ENOSYS);
  ^
include/linux/mfd/syscon.h:30:18: error: ‘ENOSYS’ undeclared (first use in this function)
  return ERR_PTR(-ENOSYS);
                  ^

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 include/linux/mfd/syscon.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
index 8789fa3..75e543b 100644
--- a/include/linux/mfd/syscon.h
+++ b/include/linux/mfd/syscon.h
@@ -15,6 +15,8 @@
 #ifndef __LINUX_MFD_SYSCON_H__
 #define __LINUX_MFD_SYSCON_H__
 
+#include <linux/err.h>
+
 struct device_node;
 
 #ifdef CONFIG_MFD_SYSCON
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: syscon: Include linux/err.h to fix build error
  2014-05-09 11:07 [PATCH] mfd: syscon: Include linux/err.h to fix build error Tushar Behera
@ 2014-05-09 11:15 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2014-05-09 11:15 UTC (permalink / raw)
  To: Tushar Behera; +Cc: linux-kernel, sameo, peter.chen

On Fri, 09 May 2014, Tushar Behera wrote:

> commit df73de9b0d412 ("mfd: syscon: Return -ENOSYS if CONFIG_MFD_SYSCON
> is not enabled") introduced fallbacks for APIs, but missed out on adding
> the header file. This would work only if linux/err.h is also included
> in the source code from where this file is included. It would be better
> to include linux/err.h in file to remove possible build errors.
> 
> Without this patch, we get following and similar build errors if this
> header file is included in some source file and CONFIG_MFD_SYSCON is
> not enabled.
> 
> include/linux/mfd/syscon.h: In function ‘syscon_node_to_regmap’:
> include/linux/mfd/syscon.h:30:2: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration]
>   return ERR_PTR(-ENOSYS);
>   ^
> include/linux/mfd/syscon.h:30:18: error: ‘ENOSYS’ undeclared (first use in this function)
>   return ERR_PTR(-ENOSYS);
>                   ^
> 
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
>  include/linux/mfd/syscon.h |    2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-09 11:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-09 11:07 [PATCH] mfd: syscon: Include linux/err.h to fix build error Tushar Behera
2014-05-09 11:15 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®