regulator: s5m8767: Constify s5m8767_opmode_reg
Subsystems (3)
PATCH 1/2 regulator: s5m8767: Constify s5m8767_opmode_reg
The s5m8767_opmode_reg should never change, make it const.
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/s5m8767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/s5m8767.c +1 -1
@@ -115,7 +115,7 @@ static const struct sec_voltage_desc *reg_voltage_map[] = { [S5M8767_BUCK9] = &buck_voltage_val3, }; -static unsigned int s5m8767_opmode_reg[][4 ] = { +static const unsigned int s5m8767_opmode_reg[][4 ] = {/* {OFF, ON, LOWPOWER, SUSPEND} */ /* LDO1 ... LDO28 */ {0x0 ,0x3 ,0x2 ,0x1 },/* LDO1 */
Signature · 1 line
2.17.1
PATCH 2/2 regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/s5m8767.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/regulator/s5m8767.c +1 -5
@@ -339,13 +339,9 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev, unsigned int new_sel) {struct s5m8767_info *s5m8767 =rdev_get_drvdata (rdev); -const struct sec_voltage_desc *desc; -int reg_id =rdev_get_id (rdev); - - desc = reg_voltage_map[reg_id];if ((old_sel < new_sel) && s5m8767->ramp_delay) -return DIV_ROUND_UP (desc->step * (new_sel - old_sel), +return DIV_ROUND_UP (rdev->desc->uV_step * (new_sel - old_sel), s5m8767->ramp_delay *1000 );return 0 ; }
Signature · 1 line
2.17.1
Re: [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation
Quoted 5 lines · Axel Lin
Signed-off-by Axel Lin <[email protected]>--- drivers/regulator/s5m8767.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Reviewed-by Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
Quoted 7 lines · Axel Lin
The
s5m8767_opmode_regshould never change, make it const.Signed-off-by Axel Lin <[email protected]>--- drivers/regulator/s5m8767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof