From: AngeloGioacchino Del Regno Date: Thu, 1 Jun 2023 11:08:11 +0000 (+0200) Subject: leds: leds-mt6323: Open code and drop MT6323_CAL_HW_DUTY macro X-Git-Tag: v6.6.7~2452^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c58b6d906dc99554f1767c574b68ce8e133fcbb;p=platform%2Fkernel%2Flinux-starfive.git leds: leds-mt6323: Open code and drop MT6323_CAL_HW_DUTY macro There is only one instance of using this macro and it's anyway not simplifying the flow, or increasing the readability of this driver. Drop this macro by open coding it in mt6323_led_set_blink(). No functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230601110813.2373764-7-angelogioacchino.delregno@collabora.com --- diff --git a/drivers/leds/leds-mt6323.c b/drivers/leds/leds-mt6323.c index dae782d..f8bd9f1 100644 --- a/drivers/leds/leds-mt6323.c +++ b/drivers/leds/leds-mt6323.c @@ -57,8 +57,6 @@ #define ISINK_CH_EN(i) BIT(i) #define MAX_SUPPORTED_LEDS 8 -#define MT6323_CAL_HW_DUTY(o, p, u) DIV_ROUND_CLOSEST((o) * 100000ul,\ - (p) * (u)) struct mt6323_leds; @@ -316,7 +314,7 @@ static int mt6323_led_set_blink(struct led_classdev *cdev, * Calculate duty_hw based on the percentage of period during * which the led is ON. */ - duty_hw = MT6323_CAL_HW_DUTY(*delay_on, period, spec->unit_duty); + duty_hw = DIV_ROUND_CLOSEST(*delay_on * 100000ul, period * spec->unit_duty); /* hardware doesn't support zero duty cycle. */ if (!duty_hw)