From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>
Subject: [PATCH net-next 4/6] net: phy: at803x: constify static regulator_ops
Date: Thu, 27 Aug 2020 00:56:06 +0200 [thread overview]
Message-ID: <20200826225608.90299-5-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20200826225608.90299-1-rikard.falkeborn@gmail.com>
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>
---
drivers/net/phy/at803x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 101651b2de54..ed601a7e46a0 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -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,
@@ -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 = {
--
2.28.0
next prev parent reply other threads:[~2020-08-26 22:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 1/6] net: ethernet: qualcomm: constify qca_serdev_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 2/6] net: ethernet: ravb: constify bb_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 3/6] net: renesas: sh_eth: " Rikard Falkeborn
2020-08-26 22:56 ` Rikard Falkeborn [this message]
2020-08-26 22:56 ` [PATCH net-next 5/6] net: phy: mscc: macsec: constify vsc8584_macsec_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 6/6] net: ath11k: constify ath11k_thermal_ops Rikard Falkeborn
2020-08-26 23:21 ` [PATCH net-next 0/6] drivers/net: constify static ops-variables David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200826225608.90299-5-rikard.falkeborn@gmail.com \
--to=rikard.falkeborn@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®