[PATCH v3 6/8] iio: light: si1133: add local variable for timeout

Joshua Crofts via B4 Relay
2026-04-29T15:05:50Z

From: Joshua Crofts <joshua.crofts1@gmail.com>

Add local variable for timeout to improve readability.

No functional change.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
drivers/iio/light/si1133.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c
index 939189d8c18a85ad64d8c05dfb83b5989f524791..471692057b0f16c82946507bf7d23a0004f80bf0 100644
--- a/drivers/iio/light/si1133.c
+++ b/drivers/iio/light/si1133.c
@@ -391,6 +391,7 @@ static int si1133_cmd_reset_counter(struct si1133_data *data)

static int si1133_command(struct si1133_data *data, u8 cmd)
{
+ unsigned long timeout = msecs_to_jiffies(SI1133_COMPLETION_TIMEOUT_MS);
struct device *dev = &data->client->dev;
u32 resp;
int err;
@@ -412,8 +413,7 @@ static int si1133_command(struct si1133_data *data, u8 cmd)

if (cmd == SI1133_CMD_FORCE) {
/* wait for irq */
- if (!wait_for_completion_timeout(&data->completion,
- msecs_to_jiffies(SI1133_COMPLETION_TIMEOUT_MS)))
+ if (!wait_for_completion_timeout(&data->completion, timeout))
return -ETIMEDOUT;
err = regmap_read(data->regmap, SI1133_REG_RESPONSE0, &resp);
if (err)

--
2.47.3