From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] video: backlight: add fallbacks for client functions
Date: Wed, 12 Aug 2015 10:46:45 +0200 [thread overview]
Message-ID: <1439369205-26787-4-git-send-email-l.stach@pengutronix.de> (raw)
In-Reply-To: <1439369205-26787-1-git-send-email-l.stach@pengutronix.de>
Add empty static inline function fallbacks if backlight support
is not enabled, so that drivers using the backlight don't fail to
build.
Fixes:
In function `simple_panel_ioctl':
undefined reference to `of_backlight_find'
undefined reference to `backlight_set_brightness_default'
undefined reference to `backlight_set_brightness'
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
include/video/backlight.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/video/backlight.h b/include/video/backlight.h
index 56e0341ea470..8dc49dc113e3 100644
--- a/include/video/backlight.h
+++ b/include/video/backlight.h
@@ -1,6 +1,7 @@
#ifndef __VIDEO_BACKLIGHT_H
#define __VIDEO_BACKLIGHT_H
+#ifdef CONFIG_DRIVER_VIDEO_BACKLIGHT
struct backlight_device {
int brightness;
int brightness_cur;
@@ -16,5 +17,21 @@ int backlight_set_brightness(struct backlight_device *, int brightness);
int backlight_set_brightness_default(struct backlight_device *);
int backlight_register(struct backlight_device *);
struct backlight_device *of_backlight_find(struct device_node *node);
+#else
+struct backlight_device ;
+
+static inline int
+backlight_set_brightness(struct backlight_device *dev, int brightness)
+{
+ return 0;
+}
+static inline int
+backlight_set_brightness_default(struct backlight_device *dev)
+{
+ return 0;
+}
+static inline struct backlight_device *
+of_backlight_find(struct device_node *node) { return NULL; }
+#endif
#endif /* __VIDEO_BACKLIGHT_H */
--
2.4.6
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-08-12 8:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-12 8:46 [PATCH 1/4] gpmc: depend on MTD Lucas Stach
2015-08-12 8:46 ` [PATCH 2/4] video: MTL017: depend on I2C Lucas Stach
2015-08-19 14:11 ` Sascha Hauer
2015-08-12 8:46 ` [PATCH 3/4] video: simple-panel: mode support depends on I2C and EDID Lucas Stach
2015-08-19 14:12 ` Sascha Hauer
2015-08-12 8:46 ` Lucas Stach [this message]
2015-08-19 14:13 ` [PATCH 4/4] video: backlight: add fallbacks for client functions Sascha Hauer
2015-08-19 14:10 ` [PATCH 1/4] gpmc: depend on MTD Sascha Hauer
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=1439369205-26787-4-git-send-email-l.stach@pengutronix.de \
--to=l.stach@pengutronix.de \
--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