提交 8bca98ca 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

[PATCH] paride: return proper error code

This patch makes module init return proper value instead of -1 (-EPERM).

Cc: Tim Waugh <tim@cyberelk.net>
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 138ae663
...@@ -912,12 +912,12 @@ static int __init pcd_init(void) ...@@ -912,12 +912,12 @@ static int __init pcd_init(void)
int unit; int unit;
if (disable) if (disable)
return -1; return -EINVAL;
pcd_init_units(); pcd_init_units();
if (pcd_detect()) if (pcd_detect())
return -1; return -ENODEV;
/* get the atapi capabilities page */ /* get the atapi capabilities page */
pcd_probe_capabilities(); pcd_probe_capabilities();
...@@ -925,7 +925,7 @@ static int __init pcd_init(void) ...@@ -925,7 +925,7 @@ static int __init pcd_init(void)
if (register_blkdev(major, name)) { if (register_blkdev(major, name)) {
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++)
put_disk(cd->disk); put_disk(cd->disk);
return -1; return -EBUSY;
} }
pcd_queue = blk_init_queue(do_pcd_request, &pcd_lock); pcd_queue = blk_init_queue(do_pcd_request, &pcd_lock);
...@@ -933,7 +933,7 @@ static int __init pcd_init(void) ...@@ -933,7 +933,7 @@ static int __init pcd_init(void)
unregister_blkdev(major, name); unregister_blkdev(major, name);
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++)
put_disk(cd->disk); put_disk(cd->disk);
return -1; return -ENOMEM;
} }
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
......
...@@ -933,25 +933,25 @@ static int __init pf_init(void) ...@@ -933,25 +933,25 @@ static int __init pf_init(void)
int unit; int unit;
if (disable) if (disable)
return -1; return -EINVAL;
pf_init_units(); pf_init_units();
if (pf_detect()) if (pf_detect())
return -1; return -ENODEV;
pf_busy = 0; pf_busy = 0;
if (register_blkdev(major, name)) { if (register_blkdev(major, name)) {
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
put_disk(pf->disk); put_disk(pf->disk);
return -1; return -EBUSY;
} }
pf_queue = blk_init_queue(do_pf_request, &pf_spin_lock); pf_queue = blk_init_queue(do_pf_request, &pf_spin_lock);
if (!pf_queue) { if (!pf_queue) {
unregister_blkdev(major, name); unregister_blkdev(major, name);
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
put_disk(pf->disk); put_disk(pf->disk);
return -1; return -ENOMEM;
} }
blk_queue_max_phys_segments(pf_queue, cluster); blk_queue_max_phys_segments(pf_queue, cluster);
......
...@@ -646,14 +646,14 @@ static int __init pg_init(void) ...@@ -646,14 +646,14 @@ static int __init pg_init(void)
int err; int err;
if (disable){ if (disable){
err = -1; err = -EINVAL;
goto out; goto out;
} }
pg_init_units(); pg_init_units();
if (pg_detect()) { if (pg_detect()) {
err = -1; err = -ENODEV;
goto out; goto out;
} }
......
...@@ -946,12 +946,12 @@ static int __init pt_init(void) ...@@ -946,12 +946,12 @@ static int __init pt_init(void)
int err; int err;
if (disable) { if (disable) {
err = -1; err = -EINVAL;
goto out; goto out;
} }
if (pt_detect()) { if (pt_detect()) {
err = -1; err = -ENODEV;
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册