Commit 7f1bfca4 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown

regulator: pcap: Constify static data

Driver does not modify static data with regulator description (struct
pcap_regulator), so make it const for code safety.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240909-regulator-const-v1-12-8934704a5787@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 90b94a05
...@@ -105,7 +105,7 @@ struct pcap_regulator { ...@@ -105,7 +105,7 @@ struct pcap_regulator {
.lowpwr = _lowpwr, \ .lowpwr = _lowpwr, \
} }
static struct pcap_regulator vreg_table[] = { static const struct pcap_regulator vreg_table[] = {
VREG_INFO(V1, PCAP_REG_VREG1, 1, 2, 18, 0), VREG_INFO(V1, PCAP_REG_VREG1, 1, 2, 18, 0),
VREG_INFO(V2, PCAP_REG_VREG1, 5, 6, 19, 22), VREG_INFO(V2, PCAP_REG_VREG1, 5, 6, 19, 22),
VREG_INFO(V3, PCAP_REG_VREG1, 7, 8, 20, 23), VREG_INFO(V3, PCAP_REG_VREG1, 7, 8, 20, 23),
...@@ -141,7 +141,7 @@ static struct pcap_regulator vreg_table[] = { ...@@ -141,7 +141,7 @@ static struct pcap_regulator vreg_table[] = {
static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev, static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev,
unsigned selector) unsigned selector)
{ {
struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)];
void *pcap = rdev_get_drvdata(rdev); void *pcap = rdev_get_drvdata(rdev);
/* the regulator doesn't support voltage switching */ /* the regulator doesn't support voltage switching */
...@@ -155,7 +155,7 @@ static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev, ...@@ -155,7 +155,7 @@ static int pcap_regulator_set_voltage_sel(struct regulator_dev *rdev,
static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev) static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev)
{ {
struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)];
void *pcap = rdev_get_drvdata(rdev); void *pcap = rdev_get_drvdata(rdev);
u32 tmp; u32 tmp;
...@@ -169,7 +169,7 @@ static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev) ...@@ -169,7 +169,7 @@ static int pcap_regulator_get_voltage_sel(struct regulator_dev *rdev)
static int pcap_regulator_enable(struct regulator_dev *rdev) static int pcap_regulator_enable(struct regulator_dev *rdev)
{ {
struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)];
void *pcap = rdev_get_drvdata(rdev); void *pcap = rdev_get_drvdata(rdev);
if (vreg->en == NA) if (vreg->en == NA)
...@@ -180,7 +180,7 @@ static int pcap_regulator_enable(struct regulator_dev *rdev) ...@@ -180,7 +180,7 @@ static int pcap_regulator_enable(struct regulator_dev *rdev)
static int pcap_regulator_disable(struct regulator_dev *rdev) static int pcap_regulator_disable(struct regulator_dev *rdev)
{ {
struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)];
void *pcap = rdev_get_drvdata(rdev); void *pcap = rdev_get_drvdata(rdev);
if (vreg->en == NA) if (vreg->en == NA)
...@@ -191,7 +191,7 @@ static int pcap_regulator_disable(struct regulator_dev *rdev) ...@@ -191,7 +191,7 @@ static int pcap_regulator_disable(struct regulator_dev *rdev)
static int pcap_regulator_is_enabled(struct regulator_dev *rdev) static int pcap_regulator_is_enabled(struct regulator_dev *rdev)
{ {
struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; const struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)];
void *pcap = rdev_get_drvdata(rdev); void *pcap = rdev_get_drvdata(rdev);
u32 tmp; u32 tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment