Setting a pin to "no function" should always be supported. Move this to mv88e6xxx_ptp_verify(). This allows mv88e6352_ptp_verify() to be simplified as the only supported PTP pin mode function is PTP_PF_EXTTS. Signed-off-by: Russell King (Oracle) --- drivers/net/dsa/mv88e6xxx/ptp.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c index 03f30424ba97..72ad6be05943 100644 --- a/drivers/net/dsa/mv88e6xxx/ptp.c +++ b/drivers/net/dsa/mv88e6xxx/ptp.c @@ -319,6 +319,10 @@ static int mv88e6xxx_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin, { struct mv88e6xxx_chip *chip = ptp_to_chip(ptp); + /* Always allow a pin to be set to no function */ + if (func == PTP_PF_NONE) + return 0; + return chip->info->ops->ptp_ops->ptp_verify(chip, pin, func, chan); } @@ -382,14 +386,9 @@ static int mv88e6352_ptp_enable(struct mv88e6xxx_chip *chip, static int mv88e6352_ptp_verify(struct mv88e6xxx_chip *chip, unsigned int pin, enum ptp_pin_function func, unsigned int chan) { - switch (func) { - case PTP_PF_NONE: - case PTP_PF_EXTTS: - break; - case PTP_PF_PEROUT: - case PTP_PF_PHYSYNC: + if (func != PTP_PF_EXTTS) return -EOPNOTSUPP; - } + return 0; } -- 2.47.3