diff options
author | Jaeden Amero <jaeden.amero@ni.com> | 2015-06-05 19:00:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-08 03:50:48 -0400 |
commit | 3c9a9f7fb0eee8a29cb64dfbdaef25efed17e22c (patch) | |
tree | 7da7b7a11c5d5b342f56bfaede13838fcea1f1f1 /drivers/net/phy/micrel.c | |
parent | f38b24c90528c888915ef6e3bc320bdb30b14cf2 (diff) |
net/phy: micrel: Be more const correct
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: Jaeden Amero <jaeden.amero@ni.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/micrel.c')
-rw-r--r-- | drivers/net/phy/micrel.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index ebdc357c5131..59cc5d4df621 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
@@ -288,9 +288,10 @@ static int kszphy_config_init(struct phy_device *phydev) | |||
288 | } | 288 | } |
289 | 289 | ||
290 | static int ksz9021_load_values_from_of(struct phy_device *phydev, | 290 | static int ksz9021_load_values_from_of(struct phy_device *phydev, |
291 | struct device_node *of_node, u16 reg, | 291 | const struct device_node *of_node, |
292 | char *field1, char *field2, | 292 | u16 reg, |
293 | char *field3, char *field4) | 293 | const char *field1, const char *field2, |
294 | const char *field3, const char *field4) | ||
294 | { | 295 | { |
295 | int val1 = -1; | 296 | int val1 = -1; |
296 | int val2 = -2; | 297 | int val2 = -2; |
@@ -336,8 +337,8 @@ static int ksz9021_load_values_from_of(struct phy_device *phydev, | |||
336 | 337 | ||
337 | static int ksz9021_config_init(struct phy_device *phydev) | 338 | static int ksz9021_config_init(struct phy_device *phydev) |
338 | { | 339 | { |
339 | struct device *dev = &phydev->dev; | 340 | const struct device *dev = &phydev->dev; |
340 | struct device_node *of_node = dev->of_node; | 341 | const struct device_node *of_node = dev->of_node; |
341 | 342 | ||
342 | if (!of_node && dev->parent->of_node) | 343 | if (!of_node && dev->parent->of_node) |
343 | of_node = dev->parent->of_node; | 344 | of_node = dev->parent->of_node; |
@@ -389,9 +390,9 @@ static int ksz9031_extended_read(struct phy_device *phydev, | |||
389 | } | 390 | } |
390 | 391 | ||
391 | static int ksz9031_of_load_skew_values(struct phy_device *phydev, | 392 | static int ksz9031_of_load_skew_values(struct phy_device *phydev, |
392 | struct device_node *of_node, | 393 | const struct device_node *of_node, |
393 | u16 reg, size_t field_sz, | 394 | u16 reg, size_t field_sz, |
394 | char *field[], u8 numfields) | 395 | const char *field[], u8 numfields) |
395 | { | 396 | { |
396 | int val[4] = {-1, -2, -3, -4}; | 397 | int val[4] = {-1, -2, -3, -4}; |
397 | int matches = 0; | 398 | int matches = 0; |
@@ -427,18 +428,18 @@ static int ksz9031_of_load_skew_values(struct phy_device *phydev, | |||
427 | 428 | ||
428 | static int ksz9031_config_init(struct phy_device *phydev) | 429 | static int ksz9031_config_init(struct phy_device *phydev) |
429 | { | 430 | { |
430 | struct device *dev = &phydev->dev; | 431 | const struct device *dev = &phydev->dev; |
431 | struct device_node *of_node = dev->of_node; | 432 | const struct device_node *of_node = dev->of_node; |
432 | char *clk_skews[2] = {"rxc-skew-ps", "txc-skew-ps"}; | 433 | static const char *clk_skews[2] = {"rxc-skew-ps", "txc-skew-ps"}; |
433 | char *rx_data_skews[4] = { | 434 | static const char *rx_data_skews[4] = { |
434 | "rxd0-skew-ps", "rxd1-skew-ps", | 435 | "rxd0-skew-ps", "rxd1-skew-ps", |
435 | "rxd2-skew-ps", "rxd3-skew-ps" | 436 | "rxd2-skew-ps", "rxd3-skew-ps" |
436 | }; | 437 | }; |
437 | char *tx_data_skews[4] = { | 438 | static const char *tx_data_skews[4] = { |
438 | "txd0-skew-ps", "txd1-skew-ps", | 439 | "txd0-skew-ps", "txd1-skew-ps", |
439 | "txd2-skew-ps", "txd3-skew-ps" | 440 | "txd2-skew-ps", "txd3-skew-ps" |
440 | }; | 441 | }; |
441 | char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"}; | 442 | static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"}; |
442 | 443 | ||
443 | if (!of_node && dev->parent->of_node) | 444 | if (!of_node && dev->parent->of_node) |
444 | of_node = dev->parent->of_node; | 445 | of_node = dev->parent->of_node; |
@@ -519,7 +520,7 @@ ksz9021_wr_mmd_phyreg(struct phy_device *phydev, int ptrad, int devnum, | |||
519 | static int kszphy_probe(struct phy_device *phydev) | 520 | static int kszphy_probe(struct phy_device *phydev) |
520 | { | 521 | { |
521 | const struct kszphy_type *type = phydev->drv->driver_data; | 522 | const struct kszphy_type *type = phydev->drv->driver_data; |
522 | struct device_node *np = phydev->dev.of_node; | 523 | const struct device_node *np = phydev->dev.of_node; |
523 | struct kszphy_priv *priv; | 524 | struct kszphy_priv *priv; |
524 | struct clk *clk; | 525 | struct clk *clk; |
525 | int ret; | 526 | int ret; |