Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau/nouveau/led: prevent compiling the led-code if nouveau=y and leds=m

The proper fix would have been to select LEDS_CLASS but this can lead
to a circular dependency, as found out by Arnd.

This patch implements Arnd's suggestion instead, at the cost of some
auto-magic for a fringe feature.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Intel's 0-DAY
Fixes: 8d021d71b324 ("drm/nouveau/drm/nouveau: add a LED driver for the NVIDIA logo")
Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

authored by

Martin Peres and committed by
Ben Skeggs
d72498ca 7dfee682

+1 -1
+1 -1
drivers/gpu/drm/nouveau/nouveau_led.h
··· 42 42 } 43 43 44 44 /* nouveau_led.c */ 45 - #if IS_ENABLED(CONFIG_LEDS_CLASS) 45 + #if IS_REACHABLE(CONFIG_LEDS_CLASS) 46 46 int nouveau_led_init(struct drm_device *dev); 47 47 void nouveau_led_suspend(struct drm_device *dev); 48 48 void nouveau_led_resume(struct drm_device *dev);