From: Kirill A. Shutemov Date: Fri, 26 Aug 2011 10:55:46 +0000 (+0100) Subject: intel_scu_ipcutil: fix major device number handling X-Git-Tag: upstream/snapshot3+hdmi~8871^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21893ab24c78ec844cbaffbb7bf11b33cfdea8b4;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Alan Cox Signed-off-by: Matthew Garrett --- 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 #include -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)