Commit f6c433d2 authored by Matt Redfearn's avatar Matt Redfearn Committed by Khalid Elmously

MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS

BugLink: https://bugs.launchpad.net/bugs/1775771

[ Upstream commit 0cde5b44 ]

When commit b27311e1 ("MIPS: TXx9: Add RBTX4939 board support")
added board support for the RBTX4939, it added a call to
led_classdev_register even if the LED class is built as a module.
Built-in arch code cannot call module code directly like this. Commit
b33b4407 ("MIPS: TXX9: use IS_ENABLED() macro") subsequently
changed the inclusion of this code to a single check that
CONFIG_LEDS_CLASS is either builtin or a module, but the same issue
remains.

This leads to MIPS allmodconfig builds failing when CONFIG_MACH_TX49XX=y
is set:

arch/mips/txx9/rbtx4939/setup.o: In function `rbtx4939_led_probe':
setup.c:(.init.text+0xc0): undefined reference to `of_led_classdev_register'
make: *** [Makefile:999: vmlinux] Error 1

Fix this by using the IS_BUILTIN() macro instead.

Fixes: b27311e1 ("MIPS: TXx9: Add RBTX4939 board support")
Signed-off-by: default avatarMatt Redfearn <matt.redfearn@mips.com>
Reviewed-by: default avatarJames Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18544/Signed-off-by: default avatarJames Hogan <jhogan@kernel.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent bfc4a8e7
...@@ -186,7 +186,7 @@ static void __init rbtx4939_update_ioc_pen(void) ...@@ -186,7 +186,7 @@ static void __init rbtx4939_update_ioc_pen(void)
#define RBTX4939_MAX_7SEGLEDS 8 #define RBTX4939_MAX_7SEGLEDS 8
#if IS_ENABLED(CONFIG_LEDS_CLASS) #if IS_BUILTIN(CONFIG_LEDS_CLASS)
static u8 led_val[RBTX4939_MAX_7SEGLEDS]; static u8 led_val[RBTX4939_MAX_7SEGLEDS];
struct rbtx4939_led_data { struct rbtx4939_led_data {
struct led_classdev cdev; struct led_classdev cdev;
...@@ -261,7 +261,7 @@ static inline void rbtx4939_led_setup(void) ...@@ -261,7 +261,7 @@ static inline void rbtx4939_led_setup(void)
static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val) static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val)
{ {
#if IS_ENABLED(CONFIG_LEDS_CLASS) #if IS_BUILTIN(CONFIG_LEDS_CLASS)
unsigned long flags; unsigned long flags;
local_irq_save(flags); local_irq_save(flags);
/* bit7: reserved for LED class */ /* bit7: reserved for LED class */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment