Lines Matching defs:newcon
3880 static int console_call_setup(struct console *newcon, char *options)
3884 if (!newcon->setup)
3889 err = newcon->setup(newcon, options);
3901 static int try_enable_preferred_console(struct console *newcon,
3915 if (!newcon->match ||
3916 newcon->match(newcon, c->name, c->index, c->options) != 0) {
3918 BUILD_BUG_ON(sizeof(c->name) != sizeof(newcon->name));
3919 if (strcmp(c->name, newcon->name) != 0)
3921 if (newcon->index >= 0 &&
3922 newcon->index != c->index)
3924 if (newcon->index < 0)
3925 newcon->index = c->index;
3927 if (_braille_register_console(newcon, c))
3930 err = console_call_setup(newcon, c->options);
3934 newcon->flags |= CON_ENABLED;
3936 newcon->flags |= CON_CONSDEV;
3944 static void try_enable_default_console(struct console *newcon)
3946 if (newcon->index < 0)
3947 newcon->index = 0;
3949 if (console_call_setup(newcon, NULL) != 0)
3952 newcon->flags |= CON_ENABLED;
3954 if (newcon->device)
3955 newcon->flags |= CON_CONSDEV;
3959 static u64 get_init_console_seq(struct console *newcon, bool bootcon_registered)
3965 if (newcon->flags & (CON_PRINTBUFFER | CON_BOOT)) {
3977 * device as @newcon. Since it is not known which boot console
4056 void register_console(struct console *newcon)
4058 bool use_device_lock = (newcon->flags & CON_NBCON) && newcon->write_atomic;
4069 if (WARN(con == newcon, "console '%s%d' already registered\n",
4081 if ((newcon->flags & CON_BOOT) && realcon_registered) {
4083 newcon->name, newcon->index);
4087 if (newcon->flags & CON_NBCON) {
4092 if (!nbcon_alloc(newcon))
4111 try_enable_default_console(newcon);
4116 err = try_enable_preferred_console(newcon, true);
4120 err = try_enable_preferred_console(newcon, false);
4127 if (err == -ENOENT && (newcon->flags & CON_ENABLED))
4131 if (err || newcon->flags & CON_BRL) {
4132 if (newcon->flags & CON_NBCON)
4133 nbcon_free(newcon);
4144 ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV)) {
4145 newcon->flags &= ~CON_PRINTBUFFER;
4148 newcon->dropped = 0;
4149 init_seq = get_init_console_seq(newcon, bootcon_registered);
4151 if (newcon->flags & CON_NBCON) {
4153 nbcon_seq_force(newcon, init_seq);
4156 newcon->seq = init_seq;
4159 if (newcon->flags & CON_BOOT)
4173 newcon->device_lock(newcon, &flags);
4181 newcon->flags |= CON_CONSDEV;
4182 hlist_add_head_rcu(&newcon->node, &console_list);
4184 } else if (newcon->flags & CON_CONSDEV) {
4187 hlist_add_head_rcu(&newcon->node, &console_list);
4190 hlist_add_behind_rcu(&newcon->node, console_list.first);
4201 newcon->device_unlock(newcon, flags);
4212 con_printk(KERN_INFO, newcon, "enabled\n");
4214 ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) &&