mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 3/4] linux/font.h: Stub out font functions
Date: Mon,  5 Feb 2018 09:29:34 -0800	[thread overview]
Message-ID: <20180205172935.25232-3-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180205172935.25232-1-andrew.smirnov@gmail.com>

Stub out font-related funtions functions so as to avoid having to
ifdef the code using them.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 include/linux/font.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/include/linux/font.h b/include/linux/font.h
index feeab9719..9b3699ba8 100644
--- a/include/linux/font.h
+++ b/include/linux/font.h
@@ -30,6 +30,8 @@ struct font_desc {
 /* Max. length for the name of a predefined font */
 #define MAX_FONT_NAME	32
 
+#ifdef CONFIG_FONTS
+
 extern int find_font_index(const struct font_desc *font, int ch);
 extern const struct font_desc *find_font_enum(int n);
 extern struct param_d *add_param_font(struct device_d *dev,
@@ -39,4 +41,32 @@ extern struct param_d *add_param_font(struct device_d *dev,
 
 int font_register(struct font_desc *font);
 
+#else
+
+static inline int find_font_index(const struct font_desc *font, int ch)
+{
+	return -ENOTSUPP;
+}
+
+static inline const struct font_desc *find_font_enum(int n)
+{
+	return NULL;
+}
+
+static inline struct param_d *
+add_param_font(struct device_d *dev,
+	       int (*set)(struct param_d *p, void *priv),
+	       int (*get)(struct param_d *p, void *priv),
+	       int *value, void *priv)
+{
+	return NULL;
+}
+
+static inline int font_register(struct font_desc *font)
+{
+	return -ENOTSUPP;
+}
+
+#endif
+
 #endif /* _VIDEO_FONT_H */
-- 
2.14.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-02-05 17:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 17:29 [PATCH 1/4] 2d-primitives: Introduce gu_draw_text() Andrey Smirnov
2018-02-05 17:29 ` [PATCH 2/4] gui: graphic_utils: Stub out fb_* functions Andrey Smirnov
2018-02-05 17:29 ` Andrey Smirnov [this message]
2018-02-05 17:29 ` [PATCH 4/4] commands: version: Add framebuffer output support Andrey Smirnov
2018-02-09  7:29   ` Sascha Hauer
2018-02-16 13:39     ` Andrey Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180205172935.25232-3-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox