mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-01 03:11:59 +00:00
leds: flash: Add flash registration with undefined CONFIG_LEDS_CLASS_FLASH
Add flash registration with undefined CONFIG_LEDS_CLASS_FLASH, and move the same registration functions outside of #ifdef block. Signed-off-by: Gene Chen <gene_chen@richtek.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
parent
c3987cd2bc
commit
8e5c38a33c
1 changed files with 33 additions and 9 deletions
|
@ -85,6 +85,7 @@ static inline struct led_classdev_flash *lcdev_to_flcdev(
|
||||||
return container_of(lcdev, struct led_classdev_flash, led_cdev);
|
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
|
* led_classdev_flash_register_ext - register a new object of LED class with
|
||||||
* init data and with support for flash LEDs
|
* init data and with support for flash LEDs
|
||||||
|
@ -98,12 +99,6 @@ int led_classdev_flash_register_ext(struct device *parent,
|
||||||
struct led_classdev_flash *fled_cdev,
|
struct led_classdev_flash *fled_cdev,
|
||||||
struct led_init_data *init_data);
|
struct led_init_data *init_data);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* led_classdev_flash_unregister - unregisters an object of led_classdev class
|
* led_classdev_flash_unregister - unregisters an object of led_classdev class
|
||||||
* with support for flash LEDs
|
* with support for flash LEDs
|
||||||
|
@ -118,15 +113,44 @@ int devm_led_classdev_flash_register_ext(struct device *parent,
|
||||||
struct led_init_data *init_data);
|
struct led_init_data *init_data);
|
||||||
|
|
||||||
|
|
||||||
|
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 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void devm_led_classdev_flash_unregister(struct device *parent,
|
||||||
|
struct led_classdev_flash *fled_cdev)
|
||||||
|
{};
|
||||||
|
|
||||||
|
#endif /* IS_ENABLED(CONFIG_LEDS_CLASS_FLASH) */
|
||||||
|
|
||||||
|
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 int devm_led_classdev_flash_register(struct device *parent,
|
static inline int devm_led_classdev_flash_register(struct device *parent,
|
||||||
struct led_classdev_flash *fled_cdev)
|
struct led_classdev_flash *fled_cdev)
|
||||||
{
|
{
|
||||||
return devm_led_classdev_flash_register_ext(parent, fled_cdev, NULL);
|
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);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* led_set_flash_strobe - setup flash strobe
|
* led_set_flash_strobe - setup flash strobe
|
||||||
* @fled_cdev: the flash LED to set strobe on
|
* @fled_cdev: the flash LED to set strobe on
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue