diff mbox

[net-next,v2,5/5] ptp: Allow reassigning calibration pin function

Message ID 1403863533-27675-6-git-send-email-stefan.sorensen@spectralink.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Sørensen, Stefan June 27, 2014, 10:05 a.m. UTC
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 <stefan.sorensen@spectralink.com>
---
 drivers/ptp/ptp_chardev.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index 419056d..f8a7609 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;