Skip to content

Commit a2c7897

Browse files
Vadim Fedorenkokuba-moo
authored andcommitted
ptp: ocp: fix DPLL functions
In ptp_ocp driver pin actions assume sma_nr starts with 1, but for DPLL subsystem callback 0-based index was used. Fix it providing proper index. Fixes: 09eeb3a ("ptp_ocp: implement DPLL ops") Signed-off-by: Vadim Fedorenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8c3b756 commit a2c7897

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/ptp/ptp_ocp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4562,7 +4562,7 @@ static int ptp_ocp_dpll_direction_set(const struct dpll_pin *pin,
45624562
return -EOPNOTSUPP;
45634563
mode = direction == DPLL_PIN_DIRECTION_INPUT ?
45644564
SMA_MODE_IN : SMA_MODE_OUT;
4565-
return ptp_ocp_sma_store_val(bp, 0, mode, sma_nr);
4565+
return ptp_ocp_sma_store_val(bp, 0, mode, sma_nr + 1);
45664566
}
45674567

45684568
static int ptp_ocp_dpll_frequency_set(const struct dpll_pin *pin,
@@ -4583,7 +4583,7 @@ static int ptp_ocp_dpll_frequency_set(const struct dpll_pin *pin,
45834583
tbl = bp->sma_op->tbl[sma->mode];
45844584
for (i = 0; tbl[i].name; i++)
45854585
if (tbl[i].frequency == frequency)
4586-
return ptp_ocp_sma_store_val(bp, i, sma->mode, sma_nr);
4586+
return ptp_ocp_sma_store_val(bp, i, sma->mode, sma_nr + 1);
45874587
return -EINVAL;
45884588
}
45894589

@@ -4600,7 +4600,7 @@ static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,
46004600
u32 val;
46014601
int i;
46024602

4603-
val = bp->sma_op->get(bp, sma_nr);
4603+
val = bp->sma_op->get(bp, sma_nr + 1);
46044604
tbl = bp->sma_op->tbl[sma->mode];
46054605
for (i = 0; tbl[i].name; i++)
46064606
if (val == tbl[i].value) {

0 commit comments

Comments
 (0)