dp83640: let external input pins from the module parameters be defaults.
authorRichard Cochran <richardcochran@gmail.com>
Thu, 20 Mar 2014 21:21:59 +0000 (22:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Mar 2014 18:21:15 +0000 (14:21 -0400)
This patch changes the driver to use the new pin configuration method when
programming the external time stamp input signals.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/dp83640.c

index 43b583b2bed7b6cdddf745316a06870a4ac4d4ea..93db564389158c971c5d14fb7b9835888a244325 100644 (file)
@@ -468,7 +468,10 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp,
                event_num = EXT_EVENT + index;
                evnt = EVNT_WR | (event_num & EVNT_SEL_MASK) << EVNT_SEL_SHIFT;
                if (on) {
-                       gpio_num = gpio_tab[EXTTS0_GPIO + index];
+                       gpio_num = 1 + ptp_find_pin(clock->ptp_clock,
+                                                   PTP_PF_EXTTS, index);
+                       if (gpio_num < 1)
+                               return -EINVAL;
                        evnt |= (gpio_num & EVNT_GPIO_MASK) << EVNT_GPIO_SHIFT;
                        if (rq->extts.flags & PTP_FALLING_EDGE)
                                evnt |= EVNT_FALL;