Skip to content

Commit

Permalink
intel_scu_ipcutil: fix major device number handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kirill A. Shutemov authored and Matthew Garrett committed Oct 24, 2011
1 parent 6cb8c13 commit 21893ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/platform/x86/intel_scu_ipcutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 21893ab

Please sign in to comment.