Commit 5dce9df0e9936b6d7443574f07ca7fab690a06d7
Committed by
Joe Hershberger
1 parent
9bc07e8174
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
net: designware: use 'phy_connect' instead of open coded
Using 'phy_connect' instead of 'phy_find_by_mask' and 'phy_connect_dev' both deduplicates code and adds support for 'fixed-link'. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Showing 1 changed file with 3 additions and 5 deletions Side-by-side Diff
drivers/net/designware.c
... | ... | @@ -480,17 +480,15 @@ |
480 | 480 | static int dw_phy_init(struct dw_eth_dev *priv, void *dev) |
481 | 481 | { |
482 | 482 | struct phy_device *phydev; |
483 | - int mask = 0xffffffff, ret; | |
483 | + int phy_addr = -1, ret; | |
484 | 484 | |
485 | 485 | #ifdef CONFIG_PHY_ADDR |
486 | - mask = 1 << CONFIG_PHY_ADDR; | |
486 | + phy_addr = CONFIG_PHY_ADDR; | |
487 | 487 | #endif |
488 | 488 | |
489 | - phydev = phy_find_by_mask(priv->bus, mask, priv->interface); | |
489 | + phydev = phy_connect(priv->bus, phy_addr, dev, priv->interface); | |
490 | 490 | if (!phydev) |
491 | 491 | return -ENODEV; |
492 | - | |
493 | - phy_connect_dev(phydev, dev); | |
494 | 492 | |
495 | 493 | phydev->supported &= PHY_GBIT_FEATURES; |
496 | 494 | if (priv->max_speed) { |