* [PATCH] leds: ncp5623: Add MS suffix to time defines
@ 2024-03-05 13:38 Abdel Alkuor
2024-03-05 14:58 ` (subset) " Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Abdel Alkuor @ 2024-03-05 13:38 UTC (permalink / raw)
To: Pavel Machek, Lee Jones, Abdel Alkuor; +Cc: linux-leds, linux-kernel
To make the time macro defines clearer, add MS as a suffix.
Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
---
drivers/leds/rgb/leds-ncp5623.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/leds/rgb/leds-ncp5623.c b/drivers/leds/rgb/leds-ncp5623.c
index b669c55c5483..2be4ff918516 100644
--- a/drivers/leds/rgb/leds-ncp5623.c
+++ b/drivers/leds/rgb/leds-ncp5623.c
@@ -22,8 +22,8 @@
#define NCP5623_DIMMING_TIME_REG NCP5623_REG(0x7)
#define NCP5623_MAX_BRIGHTNESS 0x1f
-#define NCP5623_MAX_DIM_TIME 240 /* ms */
-#define NCP5623_DIM_STEP 8 /* ms */
+#define NCP5623_MAX_DIM_TIME_MS 240
+#define NCP5623_DIM_STEP_MS 8
struct ncp5623 {
struct i2c_client *client;
@@ -92,8 +92,8 @@ static int ncp5623_pattern_set(struct led_classdev *cdev,
ncp->delay = 0;
- if (pattern[0].delta_t > NCP5623_MAX_DIM_TIME ||
- (pattern[0].delta_t % NCP5623_DIM_STEP) != 0)
+ if (pattern[0].delta_t > NCP5623_MAX_DIM_TIME_MS ||
+ (pattern[0].delta_t % NCP5623_DIM_STEP_MS) != 0)
return -EINVAL;
brightness_diff = pattern[0].brightness - ncp->current_brightness;
@@ -117,7 +117,7 @@ static int ncp5623_pattern_set(struct led_classdev *cdev,
ret = ncp5623_write(ncp->client,
NCP5623_DIMMING_TIME_REG,
- pattern[0].delta_t / NCP5623_DIM_STEP);
+ pattern[0].delta_t / NCP5623_DIM_STEP_MS);
if (ret)
return ret;
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: (subset) [PATCH] leds: ncp5623: Add MS suffix to time defines
2024-03-05 13:38 [PATCH] leds: ncp5623: Add MS suffix to time defines Abdel Alkuor
@ 2024-03-05 14:58 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2024-03-05 14:58 UTC (permalink / raw)
To: Pavel Machek, Lee Jones, Abdel Alkuor; +Cc: linux-leds, linux-kernel
On Tue, 05 Mar 2024 08:38:17 -0500, Abdel Alkuor wrote:
> To make the time macro defines clearer, add MS as a suffix.
>
>
Applied, thanks!
[1/1] leds: ncp5623: Add MS suffix to time defines
commit: fced824b08eac94d640ba2d19f409b95f5b3b0e3
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-05 14:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05 13:38 [PATCH] leds: ncp5623: Add MS suffix to time defines Abdel Alkuor
2024-03-05 14:58 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®