Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21893ab2 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Matthew Garrett
Browse files

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: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 6cb8c13d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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)