/* Telephony For Linux device drivers request registration here.  */
int phone_register_device(struct phone_device *p, int unit)
/* Telephony For Linux device drivers request registration here.  */
int phone_register_device(struct phone_device *p, int unit)
{
	int base;
	int end;
	int i;
	base = 0;
	end = PHONE_NUM_DEVICES - 1;
	if (unit != PHONE_UNIT_ANY) {
		base = unit;
		end = unit + 1;
	}
	mutex_lock(&phone_lock);
	for (i = base; i < end; i++) {
		if (phone_device[i] == NULL) {
			phone_device[i] = p;
			p->minor = i;
			mutex_unlock(&phone_lock);
			return 0;
		}
	}
	mutex_unlock(&phone_lock);
	return -ENFILE;
}