diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2017-03-17 02:07:14 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-03-17 14:12:22 +0100 |
commit | 0630b614391f8cbc35e837b4645ec8faaaa6465e (patch) | |
tree | 3d312fb1d2fb9f6d5470a22769d96d77b66f12b7 /drivers/regulator/internal.h | |
parent | regulator: core: use snprintf() instead of scnprintf() (diff) | |
download | linux-0630b614391f8cbc35e837b4645ec8faaaa6465e.tar.xz linux-0630b614391f8cbc35e837b4645ec8faaaa6465e.zip |
regulator: Mark supply_name const and duplicate it as such
The supply_name member of struct regulator can be const as we
don't change it in the regulator core. Furthermore, when we copy
the supply name we can use kstrdup_const() here to avoid a copy
if the name is in the ro data section.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/internal.h')
-rw-r--r-- | drivers/regulator/internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/internal.h b/drivers/regulator/internal.h index 1dd575b28564..66a8ea0c8386 100644 --- a/drivers/regulator/internal.h +++ b/drivers/regulator/internal.h @@ -29,7 +29,7 @@ struct regulator { int uA_load; int min_uV; int max_uV; - char *supply_name; + const char *supply_name; struct device_attribute dev_attr; struct regulator_dev *rdev; struct dentry *debugfs; |