The error -1 is actually ERESTART in the context of syscall. It is for
kernel mode only and will not be passed to user mode. When the kernel
sees this error it will restart the syscall.
When the the SFP module data is not available, e.g. the SFP module is
not present, the ioctl handler returns ERESTART and kernel will
infinitely retry, thus the userland ifconfig -v ql0 will hang forever
until get interrupted.
Fix that by returning error ENODEV to indicate the SFP module data is
not available.
For the failure of ecore_ptt_acquire(), it appears to be quite safe to
restart, so keep it untouched.
Reported by: Steve Wheeler
See also: https://redmine.pfsense.org/issues/16248
MFC after: 3 days