mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
leds: flash: Fix multicolor no-ops registration by return 0
Fix multicolor no-ops registration by return 0, 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:
@@ -44,12 +44,6 @@ int led_classdev_multicolor_register_ext(struct device *parent,
|
|||||||
struct led_classdev_mc *mcled_cdev,
|
struct led_classdev_mc *mcled_cdev,
|
||||||
struct led_init_data *init_data);
|
struct led_init_data *init_data);
|
||||||
|
|
||||||
static inline int led_classdev_multicolor_register(struct device *parent,
|
|
||||||
struct led_classdev_mc *mcled_cdev)
|
|
||||||
{
|
|
||||||
return led_classdev_multicolor_register_ext(parent, mcled_cdev, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* led_classdev_multicolor_unregister - unregisters an object of led_classdev
|
* led_classdev_multicolor_unregister - unregisters an object of led_classdev
|
||||||
* class with support for multicolor LEDs
|
* class with support for multicolor LEDs
|
||||||
@@ -68,13 +62,6 @@ int devm_led_classdev_multicolor_register_ext(struct device *parent,
|
|||||||
struct led_classdev_mc *mcled_cdev,
|
struct led_classdev_mc *mcled_cdev,
|
||||||
struct led_init_data *init_data);
|
struct led_init_data *init_data);
|
||||||
|
|
||||||
static inline int devm_led_classdev_multicolor_register(struct device *parent,
|
|
||||||
struct led_classdev_mc *mcled_cdev)
|
|
||||||
{
|
|
||||||
return devm_led_classdev_multicolor_register_ext(parent, mcled_cdev,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void devm_led_classdev_multicolor_unregister(struct device *parent,
|
void devm_led_classdev_multicolor_unregister(struct device *parent,
|
||||||
struct led_classdev_mc *mcled_cdev);
|
struct led_classdev_mc *mcled_cdev);
|
||||||
#else
|
#else
|
||||||
@@ -83,27 +70,33 @@ static inline int led_classdev_multicolor_register_ext(struct device *parent,
|
|||||||
struct led_classdev_mc *mcled_cdev,
|
struct led_classdev_mc *mcled_cdev,
|
||||||
struct led_init_data *init_data)
|
struct led_init_data *init_data)
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
static inline int led_classdev_multicolor_register(struct device *parent,
|
|
||||||
struct led_classdev_mc *mcled_cdev)
|
|
||||||
{
|
|
||||||
return led_classdev_multicolor_register_ext(parent, mcled_cdev, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void led_classdev_multicolor_unregister(struct led_classdev_mc *mcled_cdev) {};
|
static inline void led_classdev_multicolor_unregister(struct led_classdev_mc *mcled_cdev) {};
|
||||||
static inline int led_mc_calc_color_components(struct led_classdev_mc *mcled_cdev,
|
static inline int led_mc_calc_color_components(struct led_classdev_mc *mcled_cdev,
|
||||||
enum led_brightness brightness)
|
enum led_brightness brightness)
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int devm_led_classdev_multicolor_register_ext(struct device *parent,
|
static inline int devm_led_classdev_multicolor_register_ext(struct device *parent,
|
||||||
struct led_classdev_mc *mcled_cdev,
|
struct led_classdev_mc *mcled_cdev,
|
||||||
struct led_init_data *init_data)
|
struct led_init_data *init_data)
|
||||||
{
|
{
|
||||||
return -EINVAL;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void devm_led_classdev_multicolor_unregister(struct device *parent,
|
||||||
|
struct led_classdev_mc *mcled_cdev)
|
||||||
|
{};
|
||||||
|
|
||||||
|
#endif /* IS_ENABLED(CONFIG_LEDS_CLASS_MULTICOLOR) */
|
||||||
|
|
||||||
|
static inline int led_classdev_multicolor_register(struct device *parent,
|
||||||
|
struct led_classdev_mc *mcled_cdev)
|
||||||
|
{
|
||||||
|
return led_classdev_multicolor_register_ext(parent, mcled_cdev, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int devm_led_classdev_multicolor_register(struct device *parent,
|
static inline int devm_led_classdev_multicolor_register(struct device *parent,
|
||||||
@@ -113,9 +106,4 @@ static inline int devm_led_classdev_multicolor_register(struct device *parent,
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void devm_led_classdev_multicolor_unregister(struct device *parent,
|
|
||||||
struct led_classdev_mc *mcled_cdev)
|
|
||||||
{};
|
|
||||||
|
|
||||||
#endif /* IS_ENABLED(CONFIG_LEDS_CLASS_MULTICOLOR) */
|
|
||||||
#endif /* _LINUX_MULTICOLOR_LEDS_H_INCLUDED */
|
#endif /* _LINUX_MULTICOLOR_LEDS_H_INCLUDED */
|
||||||
|
Reference in New Issue
Block a user