projects/linux·commit 505db036

[PATCH] Fix smsc_ircc_init return value

505db036 · Brice Goglin <[email protected]> · 2005-09-06 15:19:25 -07:00

I noticed a strange return value in smsc_ircc_init in
drivers/net/irda/smsc_ircc2.c in rc4-mm1.

When reaching the line "if (ircc_fir > 0 && ircc_sir > 0)", ret is 0.  So I
don't see the point of setting it to 0 in the "else" case.  >From what I
see in 2.6.12 it should probably be set to -ENODEV at the begining of the
"else" case.  The attached patch does this.

Note that I didn't actually see any breakage caused by this.

Signed-off-by: Brice Goglin <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
505db03639db34ca2c64fe7ee27190d324281f2c
Parents
0fa2f491

Changes

1 files changed · +1 −0

FileStatusAddDelContent
drivers/net/irda/smsc-ircc2.cmodified+1−0View file

drivers/net/irda/smsc-ircc2.c

View file
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index 2c9d330..dd89bda 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -360,6 +360,7 @@ static int __init smsc_ircc_init(void)
if (smsc_ircc_open(ircc_fir, ircc_sir, ircc_dma, ircc_irq))
ret = -ENODEV;
} else {
+ ret = -ENODEV;
/* try user provided configuration register base address */
if (ircc_cfg > 0) {