dev: remove console driver, merge into serial
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
parent
cfe2ee22fb
commit
52ba70f4b7
13 changed files with 163 additions and 547 deletions
22
dev/char.c
Normal file
22
dev/char.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <kernel/common.h>
|
||||
#include <kernel/ringbuf.h>
|
||||
#include <kernel/slab.h>
|
||||
|
||||
#include <kernel/char.h>
|
||||
|
||||
struct char_device *char_device_create(const char *name, void *data)
|
||||
{
|
||||
size_t name_len = strlen(name);
|
||||
struct char_device *cd = kmalloc(sizeof(struct char_device), ALLOC_KERN);
|
||||
cd->name = kzalloc(name_len + 1, ALLOC_KERN);
|
||||
cd->data = data;
|
||||
return cd;
|
||||
}
|
||||
|
||||
void char_device_destroy(struct char_device *cd)
|
||||
{
|
||||
ATTEMPT_FREE(cd->name);
|
||||
ATTEMPT_FREE(cd);
|
||||
}
|
||||
Loading…
Reference in a new issue