fujitsu-laptop: Use IS_ENABLED() instead of checking for built-in or module
Subsystems (2)
PATCH 1/1 fujitsu-laptop: Use IS_ENABLED() instead of checking for built-in or module
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either built-in or as a module, use that macro instead of open coding the same.
Signed-off-by Javier Martinez Canillas <[email protected]>
---
drivers/platform/x86/fujitsu-laptop.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/platform/x86/fujitsu-laptop.c +6 -6
@@ -69,7 +69,7 @@#include <linux/kfifo.h> #include <linux/platform_device.h> #include <linux/slab.h> -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )#include <linux/leds.h> #endif #include <acpi/video.h>
@@ -100,7 +100,7 @@/* FUNC interface - responses */ #define UNSUPPORTED_CMD 0x80000000 -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )/* FUNC interface - LED control */ #define FUNC_LED_OFF 0x1#define FUNC_LED_ON 0x30001
@@ -182,7 +182,7 @@ static struct fujitsu_hotkey_t *fujitsu_hotkey;static void acpi_fujitsu_hotkey_notify (struct acpi_device *device,u32 event); -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )static enum led_brightness logolamp_get (struct led_classdev *cdev);static void logolamp_set (struct led_classdev *cdev,enum led_brightness brightness);
@@ -261,7 +261,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)return value; } -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )/* LED class callbacks */ static void logolamp_set(struct led_classdev *cdev,
@@ -903,7 +903,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)/* Suspect this is a keymap of the application panel, print it */ pr_info ("BTNI: [0x%x]\n" ,call_fext_func (FUNC_BUTTONS ,0x0 ,0x0 ,0x0 )); -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )if (call_fext_func (FUNC_LEDS ,0x0 ,0x0 ,0x0 ) &LOGOLAMP_POWERON ) { result =led_classdev_register (&fujitsu->pf_device->dev, &logolamp_led);
@@ -963,7 +963,7 @@ static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)struct fujitsu_hotkey_t *fujitsu_hotkey =acpi_driver_data (device);struct input_dev *input = fujitsu_hotkey->input; -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )if (fujitsu_hotkey->logolamp_registered)led_classdev_unregister (&logolamp_led);
Signature · 1 line
2.5.5
Quoted 4 lines · Javier Martinez Canillas
The
IS_ENABLED()macro checks if aKconfigsymbol has been enabled either built-in or as a module, use that macro instead of open coding the same.Signed-off-by Javier Martinez Canillas <[email protected]>
Acked-by Jonathan Woithe <[email protected]>
Quoted 65 lines
---
drivers/platform/x86/fujitsu-laptop.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/platform/x86/fujitsu-laptop.c +6
-6@@ -69,7 +69,7 @@#include <linux/kfifo.h> #include <linux/platform_device.h> #include <linux/slab.h> -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )#include <linux/leds.h> #endif #include <acpi/video.h> @@ -100,7 +100,7 @@/* FUNC interface - responses */ #define UNSUPPORTED_CMD 0x80000000 -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )/* FUNC interface - LED control */ #define FUNC_LED_OFF 0x1#define FUNC_LED_ON 0x30001@@ -182,7 +182,7 @@ static struct fujitsu_hotkey_t *fujitsu_hotkey;static void acpi_fujitsu_hotkey_notify (struct acpi_device *device,u32 event); -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )static enum led_brightness logolamp_get (struct led_classdev *cdev);static void logolamp_set (struct led_classdev *cdev,enum led_brightness brightness);@@ -261,7 +261,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)return value; } -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )/* LED class callbacks */ static void logolamp_set(struct led_classdev *cdev,@@ -903,7 +903,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)/* Suspect this is a keymap of the application panel, print it */ pr_info ("BTNI: [0x%x]\n" ,call_fext_func (FUNC_BUTTONS ,0x0 ,0x0 ,0x0 )); -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )if (call_fext_func (FUNC_LEDS ,0x0 ,0x0 ,0x0 ) &LOGOLAMP_POWERON ) { result =led_classdev_register (&fujitsu->pf_device->dev, &logolamp_led);@@ -963,7 +963,7 @@ static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)struct fujitsu_hotkey_t *fujitsu_hotkey =acpi_driver_data (device);struct input_dev *input = fujitsu_hotkey->input; -#if defined(CONFIG_LEDS_CLASS ) || defined(CONFIG_LEDS_CLASS_MODULE ) +#if IS_ENABLED (CONFIG_LEDS_CLASS )if (fujitsu_hotkey->logolamp_registered)led_classdev_unregister (&logolamp_led);Signature · 1 line
2.5.5
Darren Hart
AppliedQuoted 7 lines · Jonathan Woithe
Quoted 4 lines · Javier Martinez Canillas
The
IS_ENABLED()macro checks if aKconfigsymbol has been enabled either built-in or as a module, use that macro instead of open coding the same.Signed-off-by Javier Martinez Canillas <[email protected]>Acked-by Jonathan Woithe <[email protected]>
Queued, thank you.
Signature · 2 lines
Darren Hart Intel Open Source Technology Center