size_t bufsize = PAGE_SIZE;
unsigned long flags;
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
*buf_pointer = '\0';
for (i = 0; i < 256; i++) {
if (bufsize <= 1)
bufsize -= len;
buf_pointer += len;
}
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return buf_pointer - buf;
}
size_t desc_length = 0;
int i;
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
while (cp < end) {
while ((cp < end) && (*cp == ' ' || *cp == '\t'))
spk_reset_default_chartab();
}
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
report_char_chartab_status(reset, received, used, rejected,
do_characters);
return retval;
u_char *cp1;
u_char ch;
unsigned long flags;
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
cp1 = spk_key_buf + SHIFT_TBL_SIZE;
num_keys = (int)(*cp1);
nstates = (int)cp1[1];
}
}
cp += sprintf(cp, "0, %d\n", KEY_MAP_VER);
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return (int)(cp-buf);
}
u_char *cp1;
unsigned long flags;
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
in_buff = kmemdup(buf, count + 1, GFP_ATOMIC);
if (!in_buff) {
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return -ENOMEM;
}
if (strchr("dDrR", *in_buff)) {
spk_set_key_info(spk_key_defaults, spk_key_buf);
pr_info("keymap set to default values\n");
kfree(in_buff);
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return count;
}
if (in_buff[count - 1] == '\n')
pr_warn("i %d %d %d %d\n", i,
(int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
kfree(in_buff);
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return -EINVAL;
}
while (--i >= 0) {
}
}
kfree(in_buff);
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return ret;
}
pr_warn("silent value '%c' not in range (0,7)\n", ch);
return -EINVAL;
}
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
if (ch&2) {
shut = 1;
spk_do_flush();
spk_shut_up |= shut;
else
spk_shut_up &= ~shut;
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return count;
}
return -EINVAL;
}
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
pb = (struct st_bits_data *) &spk_punc_info[var->value];
mask = pb->mask;
for (i = 33; i < 128; i++) {
continue;
*cp++ = (char)i;
}
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return cp-buf;
}
x--;
punc_buf[x] = '\0';
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
if (*punc_buf == 'd' || *punc_buf == 'r')
x = spk_set_mask_bits(0, var->value, 3);
else
x = spk_set_mask_bits(punc_buf, var->value, 3);
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return count;
}
if (param == NULL)
return -EINVAL;
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
var = (struct var_t *) param->data;
switch (param->var_type) {
case VAR_NUM:
param->name, param->var_type);
break;
}
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return rv;
}
EXPORT_SYMBOL_GPL(spk_var_show);
cp = (char *)buf;
string_unescape_any_inplace(cp);
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
switch (param->var_type) {
case VAR_NUM:
case VAR_TIME:
}
}
}
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (ret == -ERESTART)
pr_info("%s reset to default value\n", attr->attr.name);
unsigned long flags;
BUG_ON(!group);
- spk_lock(flags);
+ spin_lock_irqsave(&speakup_info.spinlock, flags);
retval = message_show_helper(buf, group->start, group->end);
- spk_unlock(flags);
+ spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return retval;
}