From a700043862754c35709a2607ba1eaff919d1faf7 Mon Sep 17 00:00:00 2001 From: vax-r Date: Tue, 30 Jan 2024 15:49:03 +0800 Subject: [PATCH] Fix typo Correct "dynamicly" to "dynamically" and correct "initialised" to "initialized". --- examples/hello-sysfs.c | 2 +- lkmpg.tex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hello-sysfs.c b/examples/hello-sysfs.c index 6f7184a..6e4f7cf 100644 --- a/examples/hello-sysfs.c +++ b/examples/hello-sysfs.c @@ -34,7 +34,7 @@ static int __init mymodule_init(void) { int error = 0; - pr_info("mymodule: initialised\n"); + pr_info("mymodule: initialized\n"); mymodule = kobject_create_and_add("mymodule", kernel_kobj); if (!mymodule) diff --git a/lkmpg.tex b/lkmpg.tex index 9d7bc22..fd06359 100644 --- a/lkmpg.tex +++ b/lkmpg.tex @@ -1052,7 +1052,7 @@ int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count, const ch \end{code} The choice between two different functions depends on whether you know the major numbers for your device. -Using \cpp|register_chrdev_region| if you know the device major number and \cpp|alloc_chrdev_region| if you would like to allocate a dynamicly-allocated major number. +Using \cpp|register_chrdev_region| if you know the device major number and \cpp|alloc_chrdev_region| if you would like to allocate a dynamically-allocated major number. Second, we should initialize the data structure \cpp|struct cdev| for our char device and associate it with the device numbers. To initialize the \cpp|struct cdev|, we can achieve by the similar sequence of the following codes.