Skip to content

Commit

Permalink
fbdev: Make fb-notify a no-op if CONFIG_FB=n
Browse files Browse the repository at this point in the history
There's no point in having support for framebuffer notifications
is CONFIG_FB is disabled. This commit adds the necessary stubs
for code to link properly when CONFIG_FB=n and moves fb-notify.o
to be built only when CONFIG_FB=y.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Ezequiel Garcia authored and Tomi Valkeinen committed Dec 15, 2015
1 parent c3c296b commit 5ec9653
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/video/fbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
menuconfig FB
tristate "Support for frame buffer devices"
select FB_CMDLINE
select FB_NOTIFY
---help---
The frame buffer device provides an abstraction for the graphics
hardware. It represents the frame buffer of some video hardware and
Expand Down Expand Up @@ -56,6 +57,9 @@ config FIRMWARE_EDID
config FB_CMDLINE
bool

config FB_NOTIFY
bool

config FB_DDC
tristate
depends on FB
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/core/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-y += fb_notify.o
obj-$(CONFIG_FB_CMDLINE) += fb_cmdline.o
obj-$(CONFIG_FB_NOTIFY) += fb_notify.o
obj-$(CONFIG_FB) += fb.o
fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \
modedb.o fbcvt.o
Expand Down
18 changes: 18 additions & 0 deletions include/linux/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,27 @@ struct fb_blit_caps {
u32 flags;
};

#ifdef CONFIG_FB_NOTIFY
extern int fb_register_client(struct notifier_block *nb);
extern int fb_unregister_client(struct notifier_block *nb);
extern int fb_notifier_call_chain(unsigned long val, void *v);
#else
static inline int fb_register_client(struct notifier_block *nb)
{
return 0;
};

static inline int fb_unregister_client(struct notifier_block *nb)
{
return 0;
};

static inline int fb_notifier_call_chain(unsigned long val, void *v)
{
return 0;
};
#endif

/*
* Pixmap structure definition
*
Expand Down

0 comments on commit 5ec9653

Please sign in to comment.