Skip to content

Commit 5eed493

Browse files
committed
chardev: remove needless class method
"chr_option_parsed" is only implemented by the "mux" chardev, we can specialize the code there to avoid the needless generic class method. Signed-off-by: Marc-André Lureau <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]>
1 parent 692277f commit 5eed493

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

chardev/char-mux.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,9 @@ void suspend_mux_open(void)
386386
static int chardev_options_parsed_cb(Object *child, void *opaque)
387387
{
388388
Chardev *chr = (Chardev *)child;
389-
ChardevClass *class = CHARDEV_GET_CLASS(chr);
390389

391-
if (!chr->be_open && class->chr_options_parsed) {
392-
class->chr_options_parsed(chr);
390+
if (!chr->be_open && CHARDEV_IS_MUX(chr)) {
391+
open_muxes(chr);
393392
}
394393

395394
return 0;
@@ -412,7 +411,6 @@ static void char_mux_class_init(ObjectClass *oc, void *data)
412411
cc->chr_accept_input = mux_chr_accept_input;
413412
cc->chr_add_watch = mux_chr_add_watch;
414413
cc->chr_be_event = mux_chr_be_event;
415-
cc->chr_options_parsed = open_muxes;
416414
cc->chr_update_read_handler = mux_chr_update_read_handlers;
417415
}
418416

include/chardev/char.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ struct ChardevClass {
273273
void (*chr_set_echo)(Chardev *chr, bool echo);
274274
void (*chr_set_fe_open)(Chardev *chr, int fe_open);
275275
void (*chr_be_event)(Chardev *s, QEMUChrEvent event);
276-
void (*chr_options_parsed)(Chardev *chr);
277276
};
278277

279278
Chardev *qemu_chardev_new(const char *id, const char *typename,

0 commit comments

Comments
 (0)