Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55bf851b authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron
Browse files

staging: iio: isl29028: change mdelay() to msleep()



This driver in some cases can busy wait for upwards of 100 ms. Since the
kernel at this point is not running in atomic context, and is running in
process context, we can safely use msleep() instead. This patch changes
the two occurrences of mdelay() to msleep().

Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 92196732
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ static int isl29028_enable_proximity(struct isl29028_chip *chip)
		return ret;
		return ret;


	/* Wait for conversion to be complete for first sample */
	/* Wait for conversion to be complete for first sample */
	mdelay(DIV_ROUND_UP(1000, chip->prox_sampling));
	msleep(DIV_ROUND_UP(1000, chip->prox_sampling));


	return 0;
	return 0;
}
}
@@ -192,7 +192,7 @@ static int isl29028_set_als_ir_mode(struct isl29028_chip *chip,
		return ret;
		return ret;


	/* Need to wait for conversion time if ALS/IR mode enabled */
	/* Need to wait for conversion time if ALS/IR mode enabled */
	mdelay(ISL29028_CONV_TIME_MS);
	msleep(ISL29028_CONV_TIME_MS);


	chip->als_ir_mode = mode;
	chip->als_ir_mode = mode;