Linux-LEDs Archive mirror
 help / color / mirror / Atom feed
From: Abdel Alkuor <alkuor@gmail.com>
To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	Abdel Alkuor <alkuor@gmail.com>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] leds: ncp5623: Add MS suffix to time defines
Date: Tue,  5 Mar 2024 08:38:17 -0500	[thread overview]
Message-ID: <20240305133824.1551809-1-alkuor@gmail.com> (raw)

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


             reply	other threads:[~2024-03-05 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 13:38 Abdel Alkuor [this message]
2024-03-05 14:58 ` (subset) [PATCH] leds: ncp5623: Add MS suffix to time defines Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240305133824.1551809-1-alkuor@gmail.com \
    --to=alkuor@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).