X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] intel_scu_ipcutil: fix major device number handling
@ 2011-08-26 10:55 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2011-08-26 10:55 UTC (permalink / raw)
  To: mjg, platform-driver-x86

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

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>
---

 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 b93a032..2d0f913 100644
--- a/drivers/platform/x86/intel_scu_ipcutil.c
+++ b/drivers/platform/x86/intel_scu_ipcutil.c
@@ -24,7 +24,7 @@
 #include <linux/init.h>
 #include <asm/intel_scu_ipc.h>
 
-static u32 major;
+static int major;
 
 #define MAX_FW_SIZE 264192
 
@@ -117,7 +117,11 @@ static const struct file_operations scu_ipc_fops = {
 
 static int __init ipc_module_init(void)
 {
-	return register_chrdev(0, "intel_mid_scu", &scu_ipc_fops);
+	major = register_chrdev(0, "intel_mid_scu", &scu_ipc_fops);
+	if (major < 0)
+		return major;
+
+	return 0;
 }
 
 static void __exit ipc_module_exit(void)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-26 11:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-26 10:55 [PATCH] intel_scu_ipcutil: fix major device number handling Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox