Skip to contentSkip to conversation

fec: Only pass pdev in fec_ptp_init()

PATCH Applied Fabio Estevam 2 participants 2 messages Jun 7, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fec: Only pass pdev in fec_ptp_init()

From: Fabio Estevam <[email protected]>

Passing pdev in fec_ptp_init() is enough, since we can get ndev locally.

---
 drivers/net/ethernet/freescale/fec.h      | 2 +-
 drivers/net/ethernet/freescale/fec_main.c | 2 +-
 drivers/net/ethernet/freescale/fec_ptp.c  | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/freescale/fec.h +1 -1
index b11cdbc..e3ed6c5 100644
@@ -275,7 +275,7 @@ struct fec_enet_private {
 	struct regulator *reg_phy;
 };
 
-void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev);
+void fec_ptp_init(struct platform_device *pdev);
 void fec_ptp_start_cyclecounter(struct net_device *ndev);
 int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd);
 
drivers/net/ethernet/freescale/fec_main.c +1 -1
index c42c42a..fa4a68f 100644
@@ -1945,7 +1945,7 @@ fec_probe(struct platform_device *pdev)
 	fec_reset_phy(pdev);
 
 	if (fep->bufdesc_ex)
-		fec_ptp_init(ndev, pdev);
+		fec_ptp_init(pdev);
 
 	ret = fec_enet_init(ndev);
 	if (ret)
drivers/net/ethernet/freescale/fec_ptp.c +2 -1
index 25fc960..5007e4f 100644
@@ -347,8 +347,9 @@ static void fec_time_keep(unsigned long _data)
  * cyclecounter init routine and exits.
  */
 
-void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev)
+void fec_ptp_init(struct platform_device *pdev)
 {
+	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct fec_enet_private *fep = netdev_priv(ndev);
 
 	fep->ptp_caps.owner = THIS_MODULE;
Signature · 1 line
1.8.1.2