Skip to content

Commit 4ebe059

Browse files
danish-tikuba-moo
authored andcommitted
net: ti: icssg-prueth: Stop hardcoding def_inc
The def_inc is stored in icss_iep structure. Currently default increment (ns per clock tick) is hardcoded to 4 (Clock frequency being 250 MHz). Change this to use the iep->def_inc variable as the iep structure is now accessible to the driver files. Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: MD Danish Anwar <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8f88c07 commit 4ebe059

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/ti/icssg/icssg_prueth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ static void prueth_iep_settime(void *clockops_data, u64 ns)
365365
sc_desc.cyclecounter0_set = cyclecount & GENMASK(31, 0);
366366
sc_desc.cyclecounter1_set = (cyclecount & GENMASK(63, 32)) >> 32;
367367
sc_desc.iepcount_set = ns % cycletime;
368-
sc_desc.CMP0_current = cycletime - 4; //Count from 0 to (cycle time)-4
368+
/* Count from 0 to (cycle time) - emac->iep->def_inc */
369+
sc_desc.CMP0_current = cycletime - emac->iep->def_inc;
369370

370371
memcpy_toio(sc_descp, &sc_desc, sizeof(sc_desc));
371372

0 commit comments

Comments
 (0)