Skip to content

Commit

Permalink
fbcon: Avoid extra node allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
marv7000 committed Nov 26, 2024
1 parent 40e228d commit dea706e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions modules/drv/video/fbcon/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

extern u8 fbcon_font[256 * FONT_GLYPH_SIZE];

// Internal terminal handle.
static Handle* handle;

// Internal render target.
static FrameBuffer* internal_fb;

Expand Down Expand Up @@ -156,6 +153,10 @@ static isize fbcon_write(Handle* handle, FileDescriptor* fd, const void* buf, us
return len;
}

static Handle fbcon_handle = {
.write = fbcon_write,
};

static void fbcon_post()
{
FrameBuffer* fb = fb_get_active();
Expand Down Expand Up @@ -192,9 +193,7 @@ static void fbcon_post()
i32 fbcon_init()
{
// Register device.
handle = handle_new(sizeof(Handle));
handle->write = fbcon_write;
if (devtmpfs_add_device(handle, "fbcon") == false)
if (devtmpfs_add_device(&fbcon_handle, "fbcon") == false)
{
module_log("Failed to initialize fbcon!\n");
return 1;
Expand Down

0 comments on commit dea706e

Please sign in to comment.