From: Stefan Sørensen Date: Fri, 27 Jun 2014 10:05:32 +0000 (+0200) Subject: dp83640: Get calibration pin with ptp_find_pin X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e0155950f01d26c1ae82b99d13e05b2127c7b7ff;p=linux-beck.git dp83640: Get calibration pin with ptp_find_pin For consistency, use the ptp_find_pin function to get the calibration pin, not gpio_tab. Signed-off-by: Stefan Sørensen Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index ab4811242458..293ad064905d 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -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);