git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: make pci device driver loading passive, pci bus scanner will not load them...
[lunaix-os.git]
/
lunaix-os
/
hal
/
char
/
devzero.c
diff --git
a/lunaix-os/hal/char/devzero.c
b/lunaix-os/hal/char/devzero.c
index cd4a6ebd817a7d4024b6535e757d4c698c3e0b1f..f976c266f21d291635090496a0947db133bbee44 100644
(file)
--- a/
lunaix-os/hal/char/devzero.c
+++ b/
lunaix-os/hal/char/devzero.c
@@
-20,16
+20,18
@@
__zero_rd(struct device* dev, void* buf, size_t offset, size_t len)
static int
pdev_zerodev_init(struct device_def* def)
{
static int
pdev_zerodev_init(struct device_def* def)
{
- struct device* devzero = device_a
ddseq(NULL, &def->class, NULL, "zero"
);
+ struct device* devzero = device_a
llocseq(NULL, NULL
);
devzero->ops.read_page = __zero_rd_pg;
devzero->ops.read = __zero_rd;
devzero->ops.read_page = __zero_rd_pg;
devzero->ops.read = __zero_rd;
+ device_register(devzero, &def->class, "zero");
+
return 0;
}
static struct device_def devzero_def = {
.name = "zero",
return 0;
}
static struct device_def devzero_def = {
.name = "zero",
- .class = DEVCLASS
(DEVIF_NON, DEVFN_PSEUDO, DEV_BUILTIN, 1
),
+ .class = DEVCLASS
V(DEVIF_NON, DEVFN_PSEUDO, DEV_ZERO, DEV_BUILTIN_ZERO
),
.init = pdev_zerodev_init
};
.init = pdev_zerodev_init
};
-EXPORT_DEVICE(zerodev, &devzero_def, load_
earlystage
);
+EXPORT_DEVICE(zerodev, &devzero_def, load_
onboot
);