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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
static int si1133_command(struct si1133_data *data, u8 cmd)
{
+ unsigned long timeout;
struct device *dev = &data->client->dev;
u32 resp;
int err;
if (cmd == SI1133_CMD_FORCE) {
/* wait for irq */
- if (!wait_for_completion_timeout(&data->completion,
- msecs_to_jiffies(SI1133_COMPLETION_TIMEOUT_MS))) {
+ timeout = msecs_to_jiffies(SI1133_COMPLETION_TIMEOUT_MS);
+ if (!wait_for_completion_timeout(&data->completion, timeout)) {
regmap_write(data->regmap, SI1133_REG_IRQ_ENABLE, 0);
err = -ETIMEDOUT;
goto out;