The various clock_read() method implementations do not make use of the passed struct cycle_counter except to convert to the parent struct mv88e6xxx_chip. The caller of these methods has already done this. Pass a pointer to struct mv88e6xxx_chip instead. Signed-off-by: Russell King (Oracle) --- drivers/net/dsa/mv88e6xxx/chip.h | 2 +- drivers/net/dsa/mv88e6xxx/ptp.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 2f211e55cb47..fd91d2252735 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -730,7 +730,7 @@ struct mv88e6xxx_avb_ops { }; struct mv88e6xxx_ptp_ops { - u64 (*clock_read)(struct cyclecounter *cc); + u64 (*clock_read)(struct mv88e6xxx_chip *chip); int (*ptp_enable)(struct ptp_clock_info *ptp, struct ptp_clock_request *rq, int on); int (*ptp_verify)(struct ptp_clock_info *ptp, unsigned int pin, diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c index b60e4f02c256..d907ba04eddd 100644 --- a/drivers/net/dsa/mv88e6xxx/ptp.c +++ b/drivers/net/dsa/mv88e6xxx/ptp.c @@ -138,9 +138,8 @@ mv88e6xxx_cc_coeff_get(struct mv88e6xxx_chip *chip) } } -static u64 mv88e6352_ptp_clock_read(struct cyclecounter *cc) +static u64 mv88e6352_ptp_clock_read(struct mv88e6xxx_chip *chip) { - struct mv88e6xxx_chip *chip = cc_to_chip(cc); u16 phc_time[2]; int err; @@ -152,9 +151,8 @@ static u64 mv88e6352_ptp_clock_read(struct cyclecounter *cc) return ((u32)phc_time[1] << 16) | phc_time[0]; } -static u64 mv88e6165_ptp_clock_read(struct cyclecounter *cc) +static u64 mv88e6165_ptp_clock_read(struct mv88e6xxx_chip *chip) { - struct mv88e6xxx_chip *chip = cc_to_chip(cc); u16 phc_time[2]; int err; @@ -470,7 +468,7 @@ static u64 mv88e6xxx_ptp_clock_read(struct cyclecounter *cc) struct mv88e6xxx_chip *chip = cc_to_chip(cc); if (chip->info->ops->ptp_ops->clock_read) - return chip->info->ops->ptp_ops->clock_read(cc); + return chip->info->ops->ptp_ops->clock_read(chip); return 0; } -- 2.47.3