diff options
author | Christian Gromm <christian.gromm@microchip.com> | 2016-08-19 13:09:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-21 16:50:38 +0200 |
commit | 324e87b7e135c01725a9cef02cb8436f65e65f07 (patch) | |
tree | d0517bf0cc580e6d1ca6df756c606aaa88337ad8 /drivers/staging/most/aim-cdev | |
parent | 9b28e14818ad959516e99b7ba3d1fc2e5500ca51 (diff) |
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: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most/aim-cdev')
-rw-r--r-- | drivers/staging/most/aim-cdev/cdev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index 6ca2440b07c4..db6f4586bcaf 100644 --- a/drivers/staging/most/aim-cdev/cdev.c +++ b/drivers/staging/most/aim-cdev/cdev.c @@ -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"); |