From: Stefan Sørensen Date: Fri, 27 Jun 2014 10:05:33 +0000 (+0200) Subject: ptp: Allow reassigning calibration pin function X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=72df7a7244c0d99414cbc1fd57c5cfeae964d3c1;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git ptp: Allow reassigning calibration pin function The ptp pin function programming does not allow calibration pin to change function. This is problematic on hardware that uses the default calibration pin for other purposes. Removing this limitation does not impact calibration if userspace does not reprogram the calibration pin. Signed-off-by: Stefan Sørensen Signed-off-by: David S. Miller --- diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c index 419056d7887e..f8a76090cbca 100644 --- a/drivers/ptp/ptp_chardev.c +++ b/drivers/ptp/ptp_chardev.c @@ -86,17 +86,12 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, return -EINVAL; break; case PTP_PF_PHYSYNC: - pr_err("sorry, cannot reassign the calibration pin\n"); - return -EINVAL; + if (chan != 0) + return -EINVAL; default: return -EINVAL; } - if (pin2->func == PTP_PF_PHYSYNC) { - pr_err("sorry, cannot reprogram the calibration pin\n"); - return -EINVAL; - } - if (info->verify(info, pin, func, chan)) { pr_err("driver cannot use function %u on pin %u\n", func, chan); return -EOPNOTSUPP;