From 24257e837e24367adaaf2fd332c1afd8b86a3999 Mon Sep 17 00:00:00 2001 From: Ylowy <69316865+YLowy@users.noreply.github.com> Date: Sun, 19 Sep 2021 20:39:56 +0800 Subject: [PATCH] Typo. --- lkmpg.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lkmpg.tex b/lkmpg.tex index 1d6da74..032b6df 100644 --- a/lkmpg.tex +++ b/lkmpg.tex @@ -869,7 +869,7 @@ You do this by using the \cpp|register_chrdev| function, defined by \src{include int register_chrdev(unsigned int major, const char *name, struct file_operations *fops); \end{code} -where unsigned int major is the major number you want to request, \cpp|const char *name| is the name of the device as it will appear in \verb|/proc/devices| and \cpp|struct file_operations *fops| is a pointer to the \cpp|file_operations| table for your driver. +Where unsigned int major is the major number you want to request, \cpp|const char *name| is the name of the device as it will appear in \verb|/proc/devices| and \cpp|struct file_operations *fops| is a pointer to the \cpp|file_operations| table for your driver. A negative return value means the registration failed. Note that we didn't pass the minor number to \cpp|register_chrdev|. That is because the kernel doesn't care about the minor number; only our driver uses it.