[PATCH v3 3/6] syscon: Do not return NULL when driver is not selected
Andrey Smirnov
andrew.smirnov at gmail.com
Mon May 16 09:45:58 PDT 2016
Both syscon_base_lookup_by_pdevname() and
syscon_base_lookup_by_phandle(), when implemented, do not return NULL,
so none of the code using those function is written to check for that.
Change returns to ERR_PTR(-ENOSYS), to avoid having that problem.
Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
include/mfd/syscon.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/mfd/syscon.h b/include/mfd/syscon.h
index 2044520..651d4c2 100644
--- a/include/mfd/syscon.h
+++ b/include/mfd/syscon.h
@@ -21,13 +21,13 @@ void __iomem *syscon_base_lookup_by_phandle
#else
static inline void __iomem *syscon_base_lookup_by_pdevname(const char *s)
{
- return NULL;
+ return ERR_PTR(-ENOSYS);
}
static inline void __iomem *syscon_base_lookup_by_phandle
(struct device_node *np, const char *property)
{
- return NULL;
+ return ERR_PTR(-ENOSYS);
}
#endif
--
2.5.5
More information about the barebox
mailing list