From 6a31b445fa494b992d5ddb115dd022058b787fc2 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 18 Feb 2009 22:46:40 +0200 Subject: nouveau: support backlight only when kernel does Loading nouveau.ko would fail with unknown symbols, if the backlight class device support is not provided in the kernel. Let's make the backlight support dependant on the kernel configuration. This is a bit ugly, the proper way would be to check for the config in Makefile.kernel whether to build nouveau_backlight.o at all, and if not, nouveau_drv.h should provide the stubs. Signed-off-by: Pekka Paalanen --- linux-core/nouveau_backlight.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'linux-core') diff --git a/linux-core/nouveau_backlight.c b/linux-core/nouveau_backlight.c index 32bb3e54..51c747a3 100644 --- a/linux-core/nouveau_backlight.c +++ b/linux-core/nouveau_backlight.c @@ -37,6 +37,8 @@ #include "nouveau_drm.h" #include "nouveau_reg.h" +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE + static int nv40_get_intensity(struct backlight_device *bd) { struct drm_device *dev = bl_get_data(bd); @@ -157,4 +159,17 @@ void nouveau_backlight_exit(struct drm_device *dev) if (dev_priv->backlight) backlight_device_unregister(dev_priv->backlight); -} +} + +#else /* CONFIG_BACKLIGHT_CLASS_DEVICE not set */ +int nouveau_backlight_init(struct drm_device *dev) +{ + (void)dev; + return 0; +} + +void nouveau_backlight_exit(struct drm_device *dev) +{ + (void)dev; +} +#endif /* CONFIG_BACKLIGHT_CLASS_DEVICE not set */ -- cgit v1.2.3