mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mfd: syscon: add inline nop functions to compile without option
@ 2013-11-29 15:15 Michael Grzeschik
  2013-11-29 15:24 ` Michael Grzeschik
  2013-11-29 15:25 ` Alexander Shiyan
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Grzeschik @ 2013-11-29 15:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: sameo, s.nawrocki, shc_work, kernel

The syscon interface can be used in different drivers to reach registers
of other register range via phandle. The exported functions can only be
used if the syscon interface is enabled. This patch fixes this by
adding nop functions if the syscon is not selected in the config.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 include/linux/mfd/syscon.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
index b473577f..257938e 100644
--- a/include/linux/mfd/syscon.h
+++ b/include/linux/mfd/syscon.h
@@ -17,10 +17,35 @@
 
 struct device_node;
 
+#ifdef CONFIG_MFD_SYSCON
+
 extern struct regmap *syscon_node_to_regmap(struct device_node *np);
 extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
 extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s);
 extern struct regmap *syscon_regmap_lookup_by_phandle(
 					struct device_node *np,
 					const char *property);
+
+#else
+
+static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
+{
+	return ERR_PTR(-ENODEV);
+}
+static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
+{
+	return ERR_PTR(-ENODEV);
+}
+static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s)
+{
+	return ERR_PTR(-ENODEV);
+}
+static inline struct regmap *syscon_regmap_lookup_by_phandle(
+					struct device_node *np,
+					const char *property)
+{
+	return ERR_PTR(-ENODEV);
+}
+#endif
+
 #endif /* __LINUX_MFD_SYSCON_H__ */
-- 
1.8.4.3


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

* Re: [PATCH] mfd: syscon: add inline nop functions to compile without option
  2013-11-29 15:15 [PATCH] mfd: syscon: add inline nop functions to compile without option Michael Grzeschik
@ 2013-11-29 15:24 ` Michael Grzeschik
  2013-11-29 15:25 ` Alexander Shiyan
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Grzeschik @ 2013-11-29 15:24 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: linux-kernel, sameo, s.nawrocki, shc_work, kernel

Hi,

On Fri, Nov 29, 2013 at 04:15:56PM +0100, Michael Grzeschik wrote:
> The syscon interface can be used in different drivers to reach registers
> of other register range via phandle. The exported functions can only be
> used if the syscon interface is enabled. This patch fixes this by
> adding nop functions if the syscon is not selected in the config.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---

forget this patch. It is already mainlined by Peter Chen.


Thanks,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] mfd: syscon: add inline nop functions to compile without option
  2013-11-29 15:15 [PATCH] mfd: syscon: add inline nop functions to compile without option Michael Grzeschik
  2013-11-29 15:24 ` Michael Grzeschik
@ 2013-11-29 15:25 ` Alexander Shiyan
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shiyan @ 2013-11-29 15:25 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: linux-kernel, sameo, s.nawrocki, kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 667 bytes --]

> The syscon interface can be used in different drivers to reach registers
> of other register range via phandle. The exported functions can only be
> used if the syscon interface is enabled. This patch fixes this by
> adding nop functions if the syscon is not selected in the config.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/include/linux/mfd/syscon.h?id=df73de9b0d412915384396637bf67ef9208161e9

---
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

end of thread, other threads:[~2013-11-29 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-29 15:15 [PATCH] mfd: syscon: add inline nop functions to compile without option Michael Grzeschik
2013-11-29 15:24 ` Michael Grzeschik
2013-11-29 15:25 ` Alexander Shiyan

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®