Wrap the ptp_ops->ptp_enable() method and convert it to take struct mv88e6xxx_chip. This eases the transition to generic Marvell PTP. Signed-off-by: Russell King (Oracle) --- drivers/net/dsa/mv88e6xxx/chip.h | 2 +- drivers/net/dsa/mv88e6xxx/ptp.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index ca62994f650a..7618f6db235e 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -731,7 +731,7 @@ struct mv88e6xxx_avb_ops { struct mv88e6xxx_ptp_ops { u64 (*clock_read)(struct mv88e6xxx_chip *chip); - int (*ptp_enable)(struct ptp_clock_info *ptp, + int (*ptp_enable)(struct mv88e6xxx_chip *chip, struct ptp_clock_request *rq, int on); int (*ptp_verify)(struct mv88e6xxx_chip *chip, unsigned int pin, enum ptp_pin_function func, unsigned int chan); diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c index 87d7fe407862..43c4af82cb1c 100644 --- a/drivers/net/dsa/mv88e6xxx/ptp.c +++ b/drivers/net/dsa/mv88e6xxx/ptp.c @@ -306,6 +306,14 @@ static int mv88e6xxx_ptp_settime(struct ptp_clock_info *ptp, return 0; } +static int mv88e6xxx_ptp_enable(struct ptp_clock_info *ptp, + struct ptp_clock_request *req, int enable) +{ + struct mv88e6xxx_chip *chip = ptp_to_chip(ptp); + + return chip->info->ops->ptp_ops->ptp_enable(chip, req, enable); +} + static int mv88e6xxx_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin, enum ptp_pin_function func, unsigned int chan) { @@ -360,11 +368,9 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip, return err; } -static int mv88e6352_ptp_enable(struct ptp_clock_info *ptp, +static int mv88e6352_ptp_enable(struct mv88e6xxx_chip *chip, struct ptp_clock_request *rq, int on) { - struct mv88e6xxx_chip *chip = ptp_to_chip(ptp); - switch (rq->type) { case PTP_CLK_REQ_EXTTS: return mv88e6352_ptp_enable_extts(chip, rq, on); @@ -543,7 +549,7 @@ int mv88e6xxx_ptp_setup(struct mv88e6xxx_chip *chip) chip->ptp_clock_info.adjtime = mv88e6xxx_ptp_adjtime; chip->ptp_clock_info.gettime64 = mv88e6xxx_ptp_gettime; chip->ptp_clock_info.settime64 = mv88e6xxx_ptp_settime; - chip->ptp_clock_info.enable = ptp_ops->ptp_enable; + chip->ptp_clock_info.enable = mv88e6xxx_ptp_enable; chip->ptp_clock_info.verify = mv88e6xxx_ptp_verify; chip->ptp_clock_info.do_aux_work = mv88e6xxx_hwtstamp_work; -- 2.47.3