All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: designware: use 'phy_connect' instead of open coded
@ 2019-07-15 19:53 Simon Goldschmidt
  2019-07-22 23:28 ` Joe Hershberger
  2019-07-25 18:41 ` [U-Boot] " Joe Hershberger
  0 siblings, 2 replies; 3+ messages in thread
From: Simon Goldschmidt @ 2019-07-15 19:53 UTC (permalink / raw)
  To: u-boot

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>
---

 drivers/net/designware.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 2c5d9560c5..e08f459cf4 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -480,18 +480,16 @@ static int _dw_free_pkt(struct dw_eth_dev *priv)
 static int dw_phy_init(struct dw_eth_dev *priv, void *dev)
 {
 	struct phy_device *phydev;
-	int mask = 0xffffffff, ret;
+	int phy_addr = -1, ret;
 
 #ifdef CONFIG_PHY_ADDR
-	mask = 1 << CONFIG_PHY_ADDR;
+	phy_addr = CONFIG_PHY_ADDR;
 #endif
 
-	phydev = phy_find_by_mask(priv->bus, mask, priv->interface);
+	phydev = phy_connect(priv->bus, phy_addr, dev, priv->interface);
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
-
 	phydev->supported &= PHY_GBIT_FEATURES;
 	if (priv->max_speed) {
 		ret = phy_set_supported(phydev, priv->max_speed);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] net: designware: use 'phy_connect' instead of open coded
  2019-07-15 19:53 [U-Boot] [PATCH] net: designware: use 'phy_connect' instead of open coded Simon Goldschmidt
@ 2019-07-22 23:28 ` Joe Hershberger
  2019-07-25 18:41 ` [U-Boot] " Joe Hershberger
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2019-07-22 23:28 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 15, 2019 at 2:53 PM Simon Goldschmidt
<simon.k.r.goldschmidt@gmail.com> wrote:
>
> 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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] net: designware: use 'phy_connect' instead of open coded
  2019-07-15 19:53 [U-Boot] [PATCH] net: designware: use 'phy_connect' instead of open coded Simon Goldschmidt
  2019-07-22 23:28 ` Joe Hershberger
@ 2019-07-25 18:41 ` Joe Hershberger
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2019-07-25 18:41 UTC (permalink / raw)
  To: u-boot

Hi Simon,

https://patchwork.ozlabs.org/patch/1132238/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-25 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 19:53 [U-Boot] [PATCH] net: designware: use 'phy_connect' instead of open coded Simon Goldschmidt
2019-07-22 23:28 ` Joe Hershberger
2019-07-25 18:41 ` [U-Boot] " Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.