> + if (anatop_reg->control_reg) {
> + sel = (uv - anatop_reg->min_voltage) / 25000;
sel = DIV_ROUND_UP(uv - anatop_reg->min_voltage, 25000);
Use DIV_ROUND_UP to avoid the possible truncate of integer division.
This ensures the selected volatge falls within the specified range
> --- a/drivers/regulator/Kconfig
> +++ b/drivers/regulator/Kconfig
> @@ -213,6 +213,14 @@ config REGULATOR_PCAP
> This driver provides support for the voltage regulators of the
> PCAP2 PMIC.
>
> +config REGULATOR_ANATOP
> + tristate "Freescale i.MX on-chip ANATOP LDO regulato
; This patch adds the Anatop regulator driver.
>
> Signed-off-by: Nancy Chen
> Signed-off-by: Ying-Chun Liu (PaulLiu)
> Acked-by: Shawn Guo
> Cc: Mark Brown
> Cc: Liam Girdwood
> Cc: Samuel Ortiz
> Cc: Jean-Christophe PLAGNIOL-VILLARD
> Cc: Axel Lin
The rdesc->n_vo