Skip to content

Commit 4c58b6d

Browse files
AngeloGioacchino Del Regnolag-linaro
authored andcommitted
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 <angelogioacchino.delregno@collabora.com> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230601110813.2373764-7-angelogioacchino.delregno@collabora.com
1 parent 9bef141 commit 4c58b6d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/leds/leds-mt6323.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
#define ISINK_CH_EN(i) BIT(i)
5858

5959
#define MAX_SUPPORTED_LEDS 8
60-
#define MT6323_CAL_HW_DUTY(o, p, u) DIV_ROUND_CLOSEST((o) * 100000ul,\
61-
(p) * (u))
6260

6361
struct mt6323_leds;
6462

@@ -316,7 +314,7 @@ static int mt6323_led_set_blink(struct led_classdev *cdev,
316314
* Calculate duty_hw based on the percentage of period during
317315
* which the led is ON.
318316
*/
319-
duty_hw = MT6323_CAL_HW_DUTY(*delay_on, period, spec->unit_duty);
317+
duty_hw = DIV_ROUND_CLOSEST(*delay_on * 100000ul, period * spec->unit_duty);
320318

321319
/* hardware doesn't support zero duty cycle. */
322320
if (!duty_hw)

0 commit comments

Comments
 (0)