aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/paride.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2006-12-06 23:36:21 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:33 -0500
commitb4178ab58aa81f4ed3c75c48940682fe3b45d880 (patch)
treed9bd5827ee1f9a36bf9958a56760f6206272cc2f /drivers/block/paride/paride.c
parentf4330002d11f032559954cbff68a5cad95b6d27f (diff)
[PATCH] paride_register(): shuffle return values
paride_register() returns 1 on success, 0 on failure and module init code looks like static int __init foo_init(void) { return paride_register(&foo) - 1; } which is not what one get used to. Converted to usual 0/-E convention. In case of kbic driver, unwind registration. It was just return (paride_register(&k951)||paride_register(&k971))-1; Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/paride/paride.c')
-rw-r--r--drivers/block/paride/paride.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c
index 55cabfb60cc5..e4c55e050126 100644
--- a/drivers/block/paride/paride.c
+++ b/drivers/block/paride/paride.c
@@ -237,19 +237,19 @@ int paride_register(PIP * pr)
237 if (protocols[k] && !strcmp(pr->name, protocols[k]->name)) { 237 if (protocols[k] && !strcmp(pr->name, protocols[k]->name)) {
238 printk("paride: %s protocol already registered\n", 238 printk("paride: %s protocol already registered\n",
239 pr->name); 239 pr->name);
240 return 0; 240 return -1;
241 } 241 }
242 k = 0; 242 k = 0;
243 while ((k < MAX_PROTOS) && (protocols[k])) 243 while ((k < MAX_PROTOS) && (protocols[k]))
244 k++; 244 k++;
245 if (k == MAX_PROTOS) { 245 if (k == MAX_PROTOS) {
246 printk("paride: protocol table full\n"); 246 printk("paride: protocol table full\n");
247 return 0; 247 return -1;
248 } 248 }
249 protocols[k] = pr; 249 protocols[k] = pr;
250 pr->index = k; 250 pr->index = k;
251 printk("paride: %s registered as protocol %d\n", pr->name, k); 251 printk("paride: %s registered as protocol %d\n", pr->name, k);
252 return 1; 252 return 0;
253} 253}
254 254
255EXPORT_SYMBOL(paride_register); 255EXPORT_SYMBOL(paride_register);