lkml.org 
[lkml]   [2020]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] regulator: cros-ec: Constify cros_ec_regulator_voltage_ops
Acked-by: Pi-Hsun Shih <pihsun@chromium.org>

On Sat, Jul 11, 2020 at 7:44 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> It is never modified, so make it const to allow the compiler to put it
> in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
> drivers/regulator/cros-ec-regulator.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c
> index 35f97246bc48..eeed5aac3f32 100644
> --- a/drivers/regulator/cros-ec-regulator.c
> +++ b/drivers/regulator/cros-ec-regulator.c
> @@ -142,7 +142,7 @@ static int cros_ec_regulator_set_voltage(struct regulator_dev *dev, int min_uV,
> sizeof(cmd), NULL, 0);
> }
>
> -static struct regulator_ops cros_ec_regulator_voltage_ops = {
> +static const struct regulator_ops cros_ec_regulator_voltage_ops = {
> .enable = cros_ec_regulator_enable,
> .disable = cros_ec_regulator_disable,
> .is_enabled = cros_ec_regulator_is_enabled,
> --
> 2.27.0
>

\
 
 \ /
  Last update: 2020-07-13 10:57    [W:0.061 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site