From: Philipp Zabel <p.zabel@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/6] net: phy: micrel: Be more const correct
Date: Tue, 2 Feb 2016 12:17:32 +0100 [thread overview]
Message-ID: <1454411855-4839-3-git-send-email-p.zabel@pengutronix.de> (raw)
In-Reply-To: <1454411855-4839-1-git-send-email-p.zabel@pengutronix.de>
Based on kernel commit 3c9a9f7fb0ee ("net/phy: micrel: Be more const
correct") by Jaeden Amero <jaeden.amero@ni.com>:
In a few places in this driver, we weren't using const where we could
have. Use const more.
In addition, change the arrays of strings in ksz9031_config_init() to be
not only const, but also static.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/net/phy/micrel.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 0c97e25..6f49e73 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -91,8 +91,8 @@ static int ks8051_config_init(struct phy_device *phydev)
}
static int ksz9021_load_values_from_of(struct phy_device *phydev,
- struct device_node *of_node, u16 reg,
- const char *field[])
+ const struct device_node *of_node,
+ u16 reg, const char *field[])
{
int val, regval, i;
@@ -113,8 +113,8 @@ static int ksz9021_load_values_from_of(struct phy_device *phydev,
static int ksz9021_config_init(struct phy_device *phydev)
{
- struct device_d *dev = &phydev->dev;
- struct device_node *of_node = dev->device_node;
+ const struct device_d *dev = &phydev->dev;
+ const struct device_node *of_node = dev->device_node;
const char *clk_pad_skew_names[] = {
"txen-skew-ps", "txc-skew-ps",
"rxdv-skew-ps", "rxc-skew-ps"
@@ -155,9 +155,9 @@ static int ksz9021_config_init(struct phy_device *phydev)
#define MII_KSZ9031RN_CLK_PAD_SKEW 8
static int ksz9031_of_load_skew_values(struct phy_device *phydev,
- struct device_node *of_node,
+ const struct device_node *of_node,
u16 reg, size_t field_sz,
- char *field[], u8 numfields)
+ const char *field[], u8 numfields)
{
int val[4] = {-1, -2, -3, -4};
int matches = 0;
@@ -194,18 +194,18 @@ static int ksz9031_of_load_skew_values(struct phy_device *phydev,
static int ksz9031_config_init(struct phy_device *phydev)
{
- struct device_d *dev = &phydev->dev;
- struct device_node *of_node = dev->device_node;
- char *clk_skews[2] = {"rxc-skew-ps", "txc-skew-ps"};
- char *rx_data_skews[4] = {
+ const struct device_d *dev = &phydev->dev;
+ const struct device_node *of_node = dev->device_node;
+ static const char *clk_skews[2] = {"rxc-skew-ps", "txc-skew-ps"};
+ static const char *rx_data_skews[4] = {
"rxd0-skew-ps", "rxd1-skew-ps",
"rxd2-skew-ps", "rxd3-skew-ps"
};
- char *tx_data_skews[4] = {
+ static const char *tx_data_skews[4] = {
"txd0-skew-ps", "txd1-skew-ps",
"txd2-skew-ps", "txd3-skew-ps"
};
- char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"};
+ static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"};
if (!of_node && dev->parent->device_node)
of_node = dev->parent->device_node;
--
2.7.0.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-02-02 11:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 11:17 [PATCH 1/6] net: phy: micrel: Staticise ksz8873mll_read_status() Philipp Zabel
2016-02-02 11:17 ` [PATCH 2/6] net: phy: micrel: use BIT macro Philipp Zabel
2016-02-02 11:17 ` Philipp Zabel [this message]
2016-02-02 11:17 ` [PATCH 4/6] net: phy: micrel: Center FLP timing at 16ms Philipp Zabel
2016-02-02 11:17 ` [PATCH 5/6] net: phy: micrel: Add workaround for bad autoneg Philipp Zabel
2016-02-02 11:17 ` [PATCH 6/6] net: phy: micrel: errata for KSZ9031 Philipp Zabel
2016-02-02 14:42 ` Philipp Zabel
2016-02-03 7:39 ` [PATCH 1/6] net: phy: micrel: Staticise ksz8873mll_read_status() Sascha Hauer
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=1454411855-4839-3-git-send-email-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=barebox@lists.infradead.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