Commit de9a7f6f authored by Chengguang Xu's avatar Chengguang Xu Committed by Greg Kroah-Hartman

fpga: dfl: expand minor range when registering chrdev region

Actually, total amount of available minor number
for a single major is MINORMASK + 1. So expand
minor range when registering chrdev region.
Signed-off-by: default avatarChengguang Xu <cgxu519@gmx.com>
Acked-by: default avatarWu Hao <hao.wu@intel.com>
Acked-by: default avatarAlan Tull <atull@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dfe3de8d
...@@ -322,7 +322,7 @@ static void dfl_chardev_uinit(void) ...@@ -322,7 +322,7 @@ static void dfl_chardev_uinit(void)
for (i = 0; i < DFL_FPGA_DEVT_MAX; i++) for (i = 0; i < DFL_FPGA_DEVT_MAX; i++)
if (MAJOR(dfl_chrdevs[i].devt)) { if (MAJOR(dfl_chrdevs[i].devt)) {
unregister_chrdev_region(dfl_chrdevs[i].devt, unregister_chrdev_region(dfl_chrdevs[i].devt,
MINORMASK); MINORMASK + 1);
dfl_chrdevs[i].devt = MKDEV(0, 0); dfl_chrdevs[i].devt = MKDEV(0, 0);
} }
} }
...@@ -332,8 +332,8 @@ static int dfl_chardev_init(void) ...@@ -332,8 +332,8 @@ static int dfl_chardev_init(void)
int i, ret; int i, ret;
for (i = 0; i < DFL_FPGA_DEVT_MAX; i++) { for (i = 0; i < DFL_FPGA_DEVT_MAX; i++) {
ret = alloc_chrdev_region(&dfl_chrdevs[i].devt, 0, MINORMASK, ret = alloc_chrdev_region(&dfl_chrdevs[i].devt, 0,
dfl_chrdevs[i].name); MINORMASK + 1, dfl_chrdevs[i].name);
if (ret) if (ret)
goto exit; goto exit;
} }
......
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