[PATCH leds v2 03/50] leds: fsg: compile if COMPILE_TEST=y

From: Marek Behún
Date: Thu Sep 17 2020 - 18:37:07 EST


This driver can be compiled on other platforms with small change if
COMPILE_TEST=y.

Signed-off-by: Marek Behún <marek.behun@xxxxxx>
Cc: Pavel Machek <pavel@xxxxxx>
Cc: Dan Murphy <dmurphy@xxxxxx>
Cc: Rod Whitby <rod@xxxxxxxxxxxx>
---
drivers/leds/Kconfig | 2 +-
drivers/leds/leds-fsg.c | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index a008170e73cd8..7f3d16d4f0652 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -290,7 +290,7 @@ config LEDS_NET48XX
config LEDS_FSG
tristate "LED Support for the Freecom FSG-3"
depends on LEDS_CLASS
- depends on MACH_FSG
+ depends on MACH_FSG || COMPILE_TEST
help
This option enables support for the LEDs on the Freecom FSG-3.

diff --git a/drivers/leds/leds-fsg.c b/drivers/leds/leds-fsg.c
index bc6b420637d61..1ffb34baee341 100644
--- a/drivers/leds/leds-fsg.c
+++ b/drivers/leds/leds-fsg.c
@@ -16,7 +16,13 @@
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/io.h>
+
+#if IS_ENABLED(MACH_FSG)
#include <mach/hardware.h>
+#else
+/* for COMPILE_TEST */
+#define IXP4XX_EXP_BUS_BASE(x) (0x12345678 + (x))
+#endif

#define FSG_LED_WLAN_BIT 0
#define FSG_LED_WAN_BIT 1
--
2.26.2