All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pata_winbond: fix module init
@ 2010-08-03 15:27 ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2010-08-03 15:27 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-kernel, kernel-janitors, alan

winbond_init_one() returns 0 on success and an error code on failure.
In the original code, we always just released the regions and return
-ENODEV.  This was introduce in 2006 by 7e45b0e5f6f6 "[PATCH] libata:
Winbond support".

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Compile tested.

diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c
index 6d8619b..b34b594 100644
--- a/drivers/ata/pata_winbond.c
+++ b/drivers/ata/pata_winbond.c
@@ -248,9 +248,10 @@ static __init int winbond_init(void)
 
 			if (request_region(port, 2, "pata_winbond")) {
 				ret = winbond_init_one(port);
-				if (ret <= 0)
+				if (ret < 0)
 					release_region(port, 2);
-				else ct+= ret;
+				else
+					ct++;
 			}
 		}
 	}

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-17 21:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03 15:27 [patch] pata_winbond: fix module init Dan Carpenter
2010-08-03 15:27 ` Dan Carpenter
2010-08-16 19:23 ` Bartlomiej Zolnierkiewicz
2010-08-16 19:23   ` Bartlomiej Zolnierkiewicz
2010-08-17  6:29   ` Dan Carpenter
2010-08-17  6:29     ` Dan Carpenter
2010-08-17  9:52     ` Alan Cox
2010-08-17 10:07       ` Alan Cox
2010-08-17 17:39       ` Jeff Garzik
2010-08-17 17:39         ` Jeff Garzik
2010-08-17 21:52   ` Jeff Garzik
2010-08-17 21:52     ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.