diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2011-08-26 06:55:46 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-10-24 10:52:39 -0400 |
commit | 21893ab24c78ec844cbaffbb7bf11b33cfdea8b4 (patch) | |
tree | 86aab2f5c007eb112331eb928ca9e802aee7bbf4 /drivers/platform | |
parent | 6cb8c13da10855f17110421d9b13db015e11840e (diff) |
intel_scu_ipcutil: fix major device number handling
We need to save major device number to be able to use it for
unregister_chrdev() in ipc_module_exit().
ipc_module_init() must return 0 on success, not major device number.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel_scu_ipcutil.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/platform/x86/intel_scu_ipcutil.c b/drivers/platform/x86/intel_scu_ipcutil.c index b93a03259c16..2d0f9136ea9a 100644 --- a/drivers/platform/x86/intel_scu_ipcutil.c +++ b/drivers/platform/x86/intel_scu_ipcutil.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <asm/intel_scu_ipc.h> | 25 | #include <asm/intel_scu_ipc.h> |
26 | 26 | ||
27 | static u32 major; | 27 | static int major; |
28 | 28 | ||
29 | #define MAX_FW_SIZE 264192 | 29 | #define MAX_FW_SIZE 264192 |
30 | 30 | ||
@@ -117,7 +117,11 @@ static const struct file_operations scu_ipc_fops = { | |||
117 | 117 | ||
118 | static int __init ipc_module_init(void) | 118 | static int __init ipc_module_init(void) |
119 | { | 119 | { |
120 | return register_chrdev(0, "intel_mid_scu", &scu_ipc_fops); | 120 | major = register_chrdev(0, "intel_mid_scu", &scu_ipc_fops); |
121 | if (major < 0) | ||
122 | return major; | ||
123 | |||
124 | return 0; | ||
121 | } | 125 | } |
122 | 126 | ||
123 | static void __exit ipc_module_exit(void) | 127 | static void __exit ipc_module_exit(void) |