diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-12-06 23:36:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:34 -0500 |
commit | 8bca98cabf6db738b06d6f3b6d4b6c5f2a5cb7b6 (patch) | |
tree | f68a69c5b841ace15ae19b8e9da21b9ffca726b2 /drivers | |
parent | 138ae6631a3d6f86851dd53686fa88295d1398bd (diff) |
[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: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/paride/pcd.c | 8 | ||||
-rw-r--r-- | drivers/block/paride/pf.c | 8 | ||||
-rw-r--r-- | drivers/block/paride/pg.c | 4 | ||||
-rw-r--r-- | drivers/block/paride/pt.c | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index ac5ba462710b..c852eed91e4b 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c | |||
@@ -912,12 +912,12 @@ static int __init pcd_init(void) | |||
912 | int unit; | 912 | int unit; |
913 | 913 | ||
914 | if (disable) | 914 | if (disable) |
915 | return -1; | 915 | return -EINVAL; |
916 | 916 | ||
917 | pcd_init_units(); | 917 | pcd_init_units(); |
918 | 918 | ||
919 | if (pcd_detect()) | 919 | if (pcd_detect()) |
920 | return -1; | 920 | return -ENODEV; |
921 | 921 | ||
922 | /* get the atapi capabilities page */ | 922 | /* get the atapi capabilities page */ |
923 | pcd_probe_capabilities(); | 923 | pcd_probe_capabilities(); |
@@ -925,7 +925,7 @@ static int __init pcd_init(void) | |||
925 | if (register_blkdev(major, name)) { | 925 | if (register_blkdev(major, name)) { |
926 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) | 926 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) |
927 | put_disk(cd->disk); | 927 | put_disk(cd->disk); |
928 | return -1; | 928 | return -EBUSY; |
929 | } | 929 | } |
930 | 930 | ||
931 | pcd_queue = blk_init_queue(do_pcd_request, &pcd_lock); | 931 | pcd_queue = blk_init_queue(do_pcd_request, &pcd_lock); |
@@ -933,7 +933,7 @@ static int __init pcd_init(void) | |||
933 | unregister_blkdev(major, name); | 933 | unregister_blkdev(major, name); |
934 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) | 934 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) |
935 | put_disk(cd->disk); | 935 | put_disk(cd->disk); |
936 | return -1; | 936 | return -ENOMEM; |
937 | } | 937 | } |
938 | 938 | ||
939 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { | 939 | for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { |
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 1a9dee19efcf..7cdaa1951260 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c | |||
@@ -933,25 +933,25 @@ static int __init pf_init(void) | |||
933 | int unit; | 933 | int unit; |
934 | 934 | ||
935 | if (disable) | 935 | if (disable) |
936 | return -1; | 936 | return -EINVAL; |
937 | 937 | ||
938 | pf_init_units(); | 938 | pf_init_units(); |
939 | 939 | ||
940 | if (pf_detect()) | 940 | if (pf_detect()) |
941 | return -1; | 941 | return -ENODEV; |
942 | pf_busy = 0; | 942 | pf_busy = 0; |
943 | 943 | ||
944 | if (register_blkdev(major, name)) { | 944 | if (register_blkdev(major, name)) { |
945 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) | 945 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) |
946 | put_disk(pf->disk); | 946 | put_disk(pf->disk); |
947 | return -1; | 947 | return -EBUSY; |
948 | } | 948 | } |
949 | pf_queue = blk_init_queue(do_pf_request, &pf_spin_lock); | 949 | pf_queue = blk_init_queue(do_pf_request, &pf_spin_lock); |
950 | if (!pf_queue) { | 950 | if (!pf_queue) { |
951 | unregister_blkdev(major, name); | 951 | unregister_blkdev(major, name); |
952 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) | 952 | for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) |
953 | put_disk(pf->disk); | 953 | put_disk(pf->disk); |
954 | return -1; | 954 | return -ENOMEM; |
955 | } | 955 | } |
956 | 956 | ||
957 | blk_queue_max_phys_segments(pf_queue, cluster); | 957 | blk_queue_max_phys_segments(pf_queue, cluster); |
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index 13f998aa1cd3..9970aedbb5d9 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c | |||
@@ -646,14 +646,14 @@ static int __init pg_init(void) | |||
646 | int err; | 646 | int err; |
647 | 647 | ||
648 | if (disable){ | 648 | if (disable){ |
649 | err = -1; | 649 | err = -EINVAL; |
650 | goto out; | 650 | goto out; |
651 | } | 651 | } |
652 | 652 | ||
653 | pg_init_units(); | 653 | pg_init_units(); |
654 | 654 | ||
655 | if (pg_detect()) { | 655 | if (pg_detect()) { |
656 | err = -1; | 656 | err = -ENODEV; |
657 | goto out; | 657 | goto out; |
658 | } | 658 | } |
659 | 659 | ||
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 35fb26636721..c902b25e4869 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c | |||
@@ -946,12 +946,12 @@ static int __init pt_init(void) | |||
946 | int err; | 946 | int err; |
947 | 947 | ||
948 | if (disable) { | 948 | if (disable) { |
949 | err = -1; | 949 | err = -EINVAL; |
950 | goto out; | 950 | goto out; |
951 | } | 951 | } |
952 | 952 | ||
953 | if (pt_detect()) { | 953 | if (pt_detect()) { |
954 | err = -1; | 954 | err = -ENODEV; |
955 | goto out; | 955 | goto out; |
956 | } | 956 | } |
957 | 957 | ||