mirror of
https://github.com/sysprog21/lkmpg.git
synced 2024-11-28 11:23:35 +08:00
Fix typo
Correct "dynamicly" to "dynamically" and correct "initialised" to "initialized".
This commit is contained in:
parent
470fbcd97d
commit
a700043862
|
@ -34,7 +34,7 @@ static int __init mymodule_init(void)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
pr_info("mymodule: initialised\n");
|
pr_info("mymodule: initialized\n");
|
||||||
|
|
||||||
mymodule = kobject_create_and_add("mymodule", kernel_kobj);
|
mymodule = kobject_create_and_add("mymodule", kernel_kobj);
|
||||||
if (!mymodule)
|
if (!mymodule)
|
||||||
|
|
|
@ -1052,7 +1052,7 @@ int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count, const ch
|
||||||
\end{code}
|
\end{code}
|
||||||
|
|
||||||
The choice between two different functions depends on whether you know the major numbers for your device.
|
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.
|
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.
|
To initialize the \cpp|struct cdev|, we can achieve by the similar sequence of the following codes.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user