Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ethernet: lantiq_etop: use phydev from struct net_device

The private structure contain a pointer to phydev, but the structure
net_device already contain such pointer. So we can remove the pointer
phy in the private structure, and update the driver to use the
one contained in struct net_device.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Philippe Reynes and committed by
David S. Miller
d1e3a356 f4400ded

+7 -17
+7 -17
drivers/net/ethernet/lantiq_etop.c
··· 102 102 struct resource *res; 103 103 104 104 struct mii_bus *mii_bus; 105 - struct phy_device *phydev; 106 105 107 106 struct ltq_etop_chan ch[MAX_DMA_CHAN]; 108 107 int tx_free[MAX_DMA_CHAN >> 1]; ··· 306 307 static int 307 308 ltq_etop_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 308 309 { 309 - struct ltq_etop_priv *priv = netdev_priv(dev); 310 - 311 - return phy_ethtool_gset(priv->phydev, cmd); 310 + return phy_ethtool_gset(dev->phydev, cmd); 312 311 } 313 312 314 313 static int 315 314 ltq_etop_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 316 315 { 317 - struct ltq_etop_priv *priv = netdev_priv(dev); 318 - 319 - return phy_ethtool_sset(priv->phydev, cmd); 316 + return phy_ethtool_sset(dev->phydev, cmd); 320 317 } 321 318 322 319 static int 323 320 ltq_etop_nway_reset(struct net_device *dev) 324 321 { 325 - struct ltq_etop_priv *priv = netdev_priv(dev); 326 - 327 - return phy_start_aneg(priv->phydev); 322 + return phy_start_aneg(dev->phydev); 328 323 } 329 324 330 325 static const struct ethtool_ops ltq_etop_ethtool_ops = { ··· 394 401 | SUPPORTED_TP); 395 402 396 403 phydev->advertising = phydev->supported; 397 - priv->phydev = phydev; 398 404 phy_attached_info(phydev); 399 405 400 406 return 0; ··· 442 450 { 443 451 struct ltq_etop_priv *priv = netdev_priv(dev); 444 452 445 - phy_disconnect(priv->phydev); 453 + phy_disconnect(dev->phydev); 446 454 mdiobus_unregister(priv->mii_bus); 447 455 mdiobus_free(priv->mii_bus); 448 456 } ··· 461 469 ltq_dma_open(&ch->dma); 462 470 napi_enable(&ch->napi); 463 471 } 464 - phy_start(priv->phydev); 472 + phy_start(dev->phydev); 465 473 netif_tx_start_all_queues(dev); 466 474 return 0; 467 475 } ··· 473 481 int i; 474 482 475 483 netif_tx_stop_all_queues(dev); 476 - phy_stop(priv->phydev); 484 + phy_stop(dev->phydev); 477 485 for (i = 0; i < MAX_DMA_CHAN; i++) { 478 486 struct ltq_etop_chan *ch = &priv->ch[i]; 479 487 ··· 548 556 static int 549 557 ltq_etop_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 550 558 { 551 - struct ltq_etop_priv *priv = netdev_priv(dev); 552 - 553 559 /* TODO: mii-toll reports "No MII transceiver present!." ?!*/ 554 - return phy_mii_ioctl(priv->phydev, rq, cmd); 560 + return phy_mii_ioctl(dev->phydev, rq, cmd); 555 561 } 556 562 557 563 static int