]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dp83640: Get calibration pin with ptp_find_pin
authorStefan Sørensen <stefan.sorensen@spectralink.com>
Fri, 27 Jun 2014 10:05:32 +0000 (12:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jul 2014 01:52:54 +0000 (18:52 -0700)
For consistency, use the ptp_find_pin function to get the calibration pin,
not gpio_tab.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/dp83640.c

index ab4811242458e7462bb6a6450912ae9d5b478970..293ad064905d6058bb72d5e4b68f832c9053451a 100644 (file)
@@ -609,7 +609,11 @@ static void recalibrate(struct dp83640_clock *clock)
        u16 cal_gpio, cfg0, evnt, ptp_trig, trigger, val;
 
        trigger = CAL_TRIGGER;
-       cal_gpio = gpio_tab[CALIBRATE_GPIO];
+       cal_gpio = 1 + ptp_find_pin(clock->ptp_clock, PTP_PF_PHYSYNC, 0);
+       if (cal_gpio < 1) {
+               pr_err("PHY calibration pin not avaible - PHY is not calibrated.");
+               return;
+       }
 
        mutex_lock(&clock->extreg_lock);