Commit 324e87b7 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: aim-cdev: report error returned by alloc_chrdev_region

This patch forwards the error code returned by function
alloc_chrdev_region(). It is needed to stop the module
from hiding the actual cause of failure.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9b28e148
......@@ -507,8 +507,9 @@ static int __init mod_init(void)
spin_lock_init(&ch_list_lock);
ida_init(&minor_id);
if (alloc_chrdev_region(&aim_devno, 0, 50, "cdev") < 0)
return -ENOMEM;
err = alloc_chrdev_region(&aim_devno, 0, 50, "cdev");
if (err < 0)
return err;
major = MAJOR(aim_devno);
aim_class = class_create(THIS_MODULE, "most_cdev_aim");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment