Skip to content

Commit

Permalink
net: phy: at803x: constify static regulator_ops
Browse files Browse the repository at this point in the history
The only usage of vddio_regulator_ops and vddh_regulator_ops is to
assign their address to the ops field in the regulator_desc struct,
which is a const pointer. Make them const to allow the compiler to
put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rikard Falkeborn authored and David S. Miller committed Aug 26, 2020
1 parent b968a44 commit 3faaf53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/at803x.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static int at803x_rgmii_reg_get_voltage_sel(struct regulator_dev *rdev)
return (val & AT803X_DEBUG_RGMII_1V8) ? 1 : 0;
}

static struct regulator_ops vddio_regulator_ops = {
static const struct regulator_ops vddio_regulator_ops = {
.list_voltage = regulator_list_voltage_table,
.set_voltage_sel = at803x_rgmii_reg_set_voltage_sel,
.get_voltage_sel = at803x_rgmii_reg_get_voltage_sel,
Expand All @@ -364,7 +364,7 @@ static const struct regulator_desc vddio_desc = {
.owner = THIS_MODULE,
};

static struct regulator_ops vddh_regulator_ops = {
static const struct regulator_ops vddh_regulator_ops = {
};

static const struct regulator_desc vddh_desc = {
Expand Down

0 comments on commit 3faaf53

Please sign in to comment.