From: Alexander Shiyan <shc_work@mail.ru>
To: linux-fbdev@vger.kernel.org
Subject: [PATCH] lcd: Provide dummy functions if CONFIG_LCD_CLASS_DEVICE is not set
Date: Thu, 13 Mar 2014 07:31:19 +0000 [thread overview]
Message-ID: <1394695879-22845-1-git-send-email-shc_work@mail.ru> (raw)
Provide dummy functions for LCD register()/unregister() if
CONFIG_LCD_CLASS_DEVICE is not set.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
include/linux/lcd.h | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 504f624..f1c94fd 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -110,14 +110,37 @@ static inline void lcd_set_power(struct lcd_device *ld, int power)
mutex_unlock(&ld->update_lock);
}
-extern struct lcd_device *lcd_device_register(const char *name,
- struct device *parent, void *devdata, struct lcd_ops *ops);
-extern struct lcd_device *devm_lcd_device_register(struct device *dev,
- const char *name, struct device *parent,
+#if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE)
+struct lcd_device *lcd_device_register(const char *name, struct device *parent,
void *devdata, struct lcd_ops *ops);
-extern void lcd_device_unregister(struct lcd_device *ld);
-extern void devm_lcd_device_unregister(struct device *dev,
- struct lcd_device *ld);
+struct lcd_device *devm_lcd_device_register(struct device *dev,
+ const char *name, struct device *parent, void *devdata,
+ struct lcd_ops *ops);
+void lcd_device_unregister(struct lcd_device *ld);
+void devm_lcd_device_unregister(struct device *dev, struct lcd_device *ld);
+#else
+static inline struct lcd_device *lcd_device_register(const char *name,
+ struct device *parent, void *devdata, struct lcd_ops *ops)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
+static inline struct lcd_device *devm_lcd_device_register(struct device *dev,
+ const char *name, struct device *parent, void *devdata,
+ struct lcd_ops *ops)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
+static inline void lcd_device_unregister(struct lcd_device *ld)
+{
+}
+
+static inline void devm_lcd_device_unregister(struct device *dev,
+ struct lcd_device *ld)
+{
+}
+#endif
#define to_lcd_device(obj) container_of(obj, struct lcd_device, dev)
--
1.8.3.2
next reply other threads:[~2014-03-13 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 7:31 Alexander Shiyan [this message]
2014-03-13 8:23 ` [PATCH] lcd: Provide dummy functions if CONFIG_LCD_CLASS_DEVICE is not set Tomi Valkeinen
2014-03-13 9:04 ` Tomi Valkeinen
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=1394695879-22845-1-git-send-email-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=linux-fbdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).