Skip to content
Permalink
Browse files
leds: flash: Add flash registration with undefined CONFIG_LEDS_CLASS_…
…FLASH

Add flash registration with undefined CONFIG_LEDS_CLASS_FLASH

Signed-off-by: Gene Chen <gene_chen@richtek.com>
  • Loading branch information
Gene Chen authored and intel-lab-lkp committed Nov 18, 2020
1 parent 6c3e426 commit a088d9624f18b888ede6b0344163b8464db82f3b
Showing 1 changed file with 36 additions and 0 deletions.
@@ -85,6 +85,7 @@ static inline struct led_classdev_flash *lcdev_to_flcdev(
return container_of(lcdev, struct led_classdev_flash, led_cdev);
}

#if IS_ENABLED(CONFIG_LEDS_CLASS_FLASH)
/**
* led_classdev_flash_register_ext - register a new object of LED class with
* init data and with support for flash LEDs
@@ -127,6 +128,41 @@ static inline int devm_led_classdev_flash_register(struct device *parent,
void devm_led_classdev_flash_unregister(struct device *parent,
struct led_classdev_flash *fled_cdev);

#else

static inline int led_classdev_flash_register_ext(struct device *parent,
struct led_classdev_flash *fled_cdev,
struct led_init_data *init_data)
{
return -EINVAL;
}

static inline int led_classdev_flash_register(struct device *parent,
struct led_classdev_flash *fled_cdev)
{
return led_classdev_flash_register_ext(parent, fled_cdev, NULL);
}

static inline void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev) {};
static inline int devm_led_classdev_flash_register_ext(struct device *parent,
struct led_classdev_flash *fled_cdev,
struct led_init_data *init_data)
{
return -EINVAL;
}

static inline int devm_led_classdev_flash_register(struct device *parent,
struct led_classdev_flash *fled_cdev)
{
return devm_led_classdev_flash_register_ext(parent, fled_cdev, NULL);
}

void devm_led_classdev_flash_unregister(struct device *parent,
struct led_classdev_flash *fled_cdev)
{};

#endif /* IS_ENABLED(CONFIG_LEDS_CLASS_FLASH) */

/**
* led_set_flash_strobe - setup flash strobe
* @fled_cdev: the flash LED to set strobe on

0 comments on commit a088d96

Please sign in to comment.