1305
1307
vc_num = vc->vc_num;
1306
if (speakup_console[vc_num] != NULL) {
1307
kfree(speakup_console[vc_num]);
1308
speakup_console[vc_num] = NULL;
1308
kfree(speakup_console[vc_num]);
1309
speakup_console[vc_num] = NULL;
1312
1312
static u_char is_cursor;
2221
2220
unregister_keyboard_notifier(&keyboard_notifier_block);
2222
2221
unregister_vt_notifier(&vt_notifier_block);
2223
2222
speakup_unregister_devsynth();
2224
2223
del_timer(&cursor_timer);
2226
2224
kthread_stop(speakup_task);
2227
2225
speakup_task = NULL;
2228
2226
mutex_lock(&spk_mutex);
2229
2227
synth_release();
2230
2228
mutex_unlock(&spk_mutex);
2230
speakup_kobj_exit();
2232
for (i = 0; i < MAX_NR_CONSOLES; i++)
2233
kfree(speakup_console[i]);
2235
speakup_remove_virtual_keyboard();
2232
2237
for (i = 0; i < MAXVARS; i++)
2233
2238
speakup_unregister_var(i);
2236
2241
if (characters[i] != default_chars[i])
2237
2242
kfree(characters[i]);
2239
for (i = 0; speakup_console[i]; i++)
2240
kfree(speakup_console[i]);
2241
speakup_kobj_exit();
2242
speakup_remove_virtual_keyboard();
2245
2248
/* call by: module_init() */
2246
2249
static int __init speakup_init(void)
2250
2253
struct st_spk_t *first_console;
2251
2254
struct vc_data *vc = vc_cons[fg_console].d;
2252
2255
struct var_t *var;
2254
err = speakup_add_virtual_keyboard();
2257
/* These first few initializations cannot fail. */
2258
2258
initialize_msgs(); /* Initialize arrays for i18n. */
2259
first_console = kzalloc(sizeof(*first_console), GFP_KERNEL);
2260
if (!first_console) {
2264
err = speakup_kobj_init();
2268
2259
reset_default_chars();
2269
2260
reset_default_chartab();
2271
speakup_console[vc->vc_num] = first_console;
2273
pr_info("speakup %s: initialized\n", SPEAKUP_VERSION);
2275
2261
strlwr(synth_name);
2276
2262
spk_vars[0].u.n.high = vc->vc_cols;
2277
2263
for (var = spk_vars; var->var_id != MAXVARS; var++)
2286
2272
if (quiet_boot)
2287
2273
spk_shut_up |= 0x01;
2275
/* From here on out, initializations can fail. */
2276
err = speakup_add_virtual_keyboard();
2278
goto error_virtkeyboard;
2280
first_console = kzalloc(sizeof(*first_console), GFP_KERNEL);
2281
if (!first_console) {
2286
speakup_console[vc->vc_num] = first_console;
2289
2289
for (i = 0; i < MAX_NR_CONSOLES; i++)
2291
speakup_allocate(vc_cons[i].d);
2293
pr_warn("synth name on entry is: %s\n", synth_name);
2291
err = speakup_allocate(vc_cons[i].d);
2293
goto error_kobjects;
2296
err = speakup_kobj_init();
2298
goto error_kobjects;
2294
2300
synth_init(synth_name);
2295
2301
speakup_register_devsynth();
2303
* register_devsynth might fail, but this error is not fatal.
2304
* /dev/synth is an extra feature; the rest of Speakup
2305
* will work fine without it.
2297
register_keyboard_notifier(&keyboard_notifier_block);
2298
register_vt_notifier(&vt_notifier_block);
2308
err = register_keyboard_notifier(&keyboard_notifier_block);
2310
goto error_kbdnotifier;
2311
err = register_vt_notifier(&vt_notifier_block);
2313
goto error_vtnotifier;
2300
2315
speakup_task = kthread_create(speakup_thread, NULL, "speakup");
2317
if (IS_ERR(speakup_task)) {
2318
err = PTR_ERR(speakup_task);
2301
2322
set_user_nice(speakup_task, 10);
2302
if (IS_ERR(speakup_task)) {
2306
2323
wake_up_process(speakup_task);
2325
pr_info("speakup %s: initialized\n", SPEAKUP_VERSION);
2326
pr_info("synth name on entry is: %s\n", synth_name);
2310
speakup_kobj_exit();
2311
kfree(first_console);
2330
unregister_vt_notifier(&vt_notifier_block);
2333
unregister_keyboard_notifier(&keyboard_notifier_block);
2334
del_timer(&cursor_timer);
2337
speakup_unregister_devsynth();
2338
mutex_lock(&spk_mutex);
2340
mutex_unlock(&spk_mutex);
2341
speakup_kobj_exit();
2344
for (i = 0; i < MAX_NR_CONSOLES; i++)
2345
kfree(speakup_console[i]);
2313
2348
speakup_remove_virtual_keyboard();
2351
for (i = 0; i < MAXVARS; i++)
2352
speakup_unregister_var(i);
2354
for (i = 0; i < 256; i++) {
2355
if (characters[i] != default_chars[i])
2356
kfree(characters[i]);