[PATCH] mfd: mc34708: provide static inline wrapper

Sascha Hauer s.hauer at pengutronix.de
Wed Jun 26 04:35:14 EDT 2013


If the driver is disabled provide a static inline wrapper for
mc34708_get() to prevent linker errors.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/mfd/mc34708.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/mfd/mc34708.h b/include/mfd/mc34708.h
index f384c62..541c47f 100644
--- a/include/mfd/mc34708.h
+++ b/include/mfd/mc34708.h
@@ -93,7 +93,14 @@ struct mc34708 {
 	unsigned int		revision;
 };
 
-extern struct mc34708 *mc34708_get(void);
+#ifdef CONFIG_MFD_MC34708
+struct mc34708 *mc34708_get(void);
+#else
+static inline struct mc34708 *mc34708_get(void)
+{
+	return NULL;
+}
+#endif
 
 extern int mc34708_reg_read(struct mc34708 *mc34708, enum mc34708_reg reg, u32 *val);
 extern int mc34708_reg_write(struct mc34708 *mc34708, enum mc34708_reg reg, u32 val);
-- 
1.8.3.1




More information about the barebox mailing list