Skip to content

Commit c0d982b

Browse files
committed
Merge branch 'fec-ptp-fixes'
Joakim Zhang says: ==================== net: fixes for fec ptp Small fixes for fec ptp. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 56b786d + d237656 commit c0d982b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/freescale/fec_ptp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,13 @@ static u64 fec_ptp_read(const struct cyclecounter *cc)
215215
{
216216
struct fec_enet_private *fep =
217217
container_of(cc, struct fec_enet_private, cc);
218-
const struct platform_device_id *id_entry =
219-
platform_get_device_id(fep->pdev);
220218
u32 tempval;
221219

222220
tempval = readl(fep->hwp + FEC_ATIME_CTRL);
223221
tempval |= FEC_T_CTRL_CAPTURE;
224222
writel(tempval, fep->hwp + FEC_ATIME_CTRL);
225223

226-
if (id_entry->driver_data & FEC_QUIRK_BUG_CAPTURE)
224+
if (fep->quirks & FEC_QUIRK_BUG_CAPTURE)
227225
udelay(1);
228226

229227
return readl(fep->hwp + FEC_ATIME);
@@ -604,6 +602,10 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
604602
fep->ptp_caps.enable = fec_ptp_enable;
605603

606604
fep->cycle_speed = clk_get_rate(fep->clk_ptp);
605+
if (!fep->cycle_speed) {
606+
fep->cycle_speed = NSEC_PER_SEC;
607+
dev_err(&fep->pdev->dev, "clk_ptp clock rate is zero\n");
608+
}
607609
fep->ptp_inc = NSEC_PER_SEC / fep->cycle_speed;
608610

609611
spin_lock_init(&fep->tmreg_lock);

0 commit comments

Comments
 (0)