drm/nouveau: fix loading for CONFIG_BACKLIGHT_CLASS_DEVICE=n
Subsystems (3)
PATCH 1/1 drm/nouveau: fix loading for CONFIG_BACKLIGHT_CLASS_DEVICE=n
From 658956848afeff909915f9251c5c68eeafa447e2 Mon Sep 17 00:00:00 2001
From: Pekka Paalanen <[email protected]>
Date: Sat, 4 Jul 2009 19:39:23 +0300
Subject: [PATCH] drm/nouveau: fix loading for CONFIG_BACKLIGHT_CLASS_DEVICE=n
nouveau.ko was silently and unconditionally depending on CONFIG_BACKLIGHT_CLASS_DEVICE features, failing to load due to missing symbols, if the kernel did not have backlight class support.
Fix this by making the build of nouveau_backlight.o conditional on CONFIG_BACKLIGHT_CLASS_DEVICE, and letting nouveau_backlight_{init,exit}() compile to nothing if backlight class support is not enabled.
---
Not even compile-tested, so sent it for review instead of pushing it.
drivers/gpu/drm/nouveau/Makefile | 5 +++-- drivers/gpu/drm/nouveau/nouveau_drv.h | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/Makefile +3 -2
@@ -8,7 +8,7 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_fifo.o nouveau_mem.o \ nouveau_swmthd.o nouveau_sgdma.o nouveau_dma.o \ nouveau_bo.o nouveau_fence.o nouveau_gem.o nouveau_ttm.o \ nouveau_hw.o nouveau_calc.o nouveau_bios.o nouveau_i2c.o \ - nouveau_display.o nouveau_fbcon.o nouveau_backlight.o \ + nouveau_display.o nouveau_fbcon.o \ nv04_timer.o \ nv04_mc.o nv40_mc.o nv50_mc.o \ nv04_fb.o nv10_fb.o nv40_fb.o \
@@ -19,8 +19,9 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_fifo.o nouveau_mem.o \ nv50_crtc.o nv50_dac.o nv50_sor.o nv50_connector.o \ nv50_cursor.o nv50_display.o nv50_fbcon.o \ nv04_display.o nv04_output.o nv04_crtc.o nv04_cursor.o \ - nv04_fbcon.o + nv04_fbcon.o nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o +nouveau-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += nouveau_backlight.o obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o
drivers/gpu/drm/nouveau/nouveau_drv.h +13 -0
@@ -682,8 +682,21 @@ extern int nouveau_dma_init(struct nouveau_channel *);extern int nouveau_dma_wait (struct nouveau_channel *,int size);/* nouveau_backlight.c */ +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE extern int nouveau_backlight_init (struct drm_device *);extern void nouveau_backlight_exit (struct drm_device *); +#else +static inline int nouveau_backlight_init (struct drm_device *dev) +{ + (void )dev; +return 0 ; +} + +static inline void nouveau_backlight_exit (struct drm_device *dev); +{ + (void )dev; +} +#endif /* nouveau_bios.c */ extern int nouveau_parse_bios (struct drm_device *);
Signature · 1 line
1.6.3.3