[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <da86a941-2752-fd25-a74f-e22b3e82357e@gmail.com>
Date: Wed, 25 Nov 2020 19:15:30 +0100
From: Jacek Anaszewski <jacek.anaszewski@...il.com>
To: Gene Chen <gene.chen.richtek@...il.com>, pavel@....cz,
robh+dt@...nel.org, matthias.bgg@...il.com
Cc: dmurphy@...com, linux-leds@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
gene_chen@...htek.com, Wilma.Wu@...iatek.com,
shufan_lee@...htek.com, cy_huang@...htek.com,
benjamin.chao@...iatek.com
Subject: Re: [PATCH v8 1/6] leds: flash: Add flash registration with undefined
CONFIG_LEDS_CLASS_FLASH
Hi Gene,
On 11/25/20 11:51 AM, Gene Chen wrote:
> From: Gene Chen <gene_chen@...htek.com>
>
> Add flash registration with undefined CONFIG_LEDS_CLASS_FLASH
>
> Signed-off-by: Gene Chen <gene_chen@...htek.com>
> ---
> include/linux/led-class-flash.h | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h
> index 21a3358..5f36eae 100644
> --- a/include/linux/led-class-flash.h
> +++ b/include/linux/led-class-flash.h
> @@ -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 0;
> +}
> +
> +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);
> +}
This function can be placed after #ifdef block - now it is in two copies
in this file.
> +
> +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 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);
> +}
Ditto.
> +static inline 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
>
--
Best regards,
Jacek Anaszewski
Powered by blists - more mailing lists