diff mbox

pata_winbond: fix module init

Message ID 20100803152549.GQ26313@bicker
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Dan Carpenter Aug. 3, 2010, 3:27 p.m. UTC
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bartlomiej Zolnierkiewicz Aug. 16, 2010, 7:23 p.m. UTC | #1
Hi Dan,

On Tuesday 03 August 2010 05:27:47 pm Dan Carpenter wrote:
> 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".

You might like to pick up

	http://patchwork.ozlabs.org/patch/39358/

instead..

Thanks.
--
Bartlomiej Zolnierkiewicz
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dan Carpenter Aug. 17, 2010, 6:29 a.m. UTC | #2
On Mon, Aug 16, 2010 at 09:23:03PM +0200, Bartlomiej Zolnierkiewicz wrote:
> 
> Hi Dan,
> 
> On Tuesday 03 August 2010 05:27:47 pm Dan Carpenter wrote:
> > 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".
> 
> You might like to pick up
> 
> 	http://patchwork.ozlabs.org/patch/39358/
> 
> instead..
> 

I don't have the hardware, but yes, probably it's better to replace this
driver since it has never been able to load.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alan Cox Aug. 17, 2010, 10:07 a.m. UTC | #3
On Tue, 17 Aug 2010 08:29:40 +0200
Dan Carpenter <error27@gmail.com> wrote:

> On Mon, Aug 16, 2010 at 09:23:03PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > 
> > Hi Dan,
> > 
> > On Tuesday 03 August 2010 05:27:47 pm Dan Carpenter wrote:
> > > 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".
> > 
> > You might like to pick up
> > 
> > 	http://patchwork.ozlabs.org/patch/39358/
> > 
> > instead..
> > 
> 
> I don't have the hardware, but yes, probably it's better to replace this
> driver since it has never been able to load.

It was obsoleted into pata_legacy before it was ever finalised -
unfortunately I could then not get Jeff to delete it.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Garzik Aug. 17, 2010, 5:39 p.m. UTC | #4
On 08/17/2010 06:07 AM, Alan Cox wrote:
> On Tue, 17 Aug 2010 08:29:40 +0200
> Dan Carpenter<error27@gmail.com>  wrote:
>
>> On Mon, Aug 16, 2010 at 09:23:03PM +0200, Bartlomiej Zolnierkiewicz wrote:
>>>
>>> Hi Dan,
>>>
>>> On Tuesday 03 August 2010 05:27:47 pm Dan Carpenter wrote:
>>>> 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".
>>>
>>> You might like to pick up
>>>
>>> 	http://patchwork.ozlabs.org/patch/39358/
>>>
>>> instead..
>>>
>>
>> I don't have the hardware, but yes, probably it's better to replace this
>> driver since it has never been able to load.
>
> It was obsoleted into pata_legacy before it was ever finalised -
> unfortunately I could then not get Jeff to delete it.

Easy enough to delete now...


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Garzik Aug. 17, 2010, 9:52 p.m. UTC | #5
On 08/16/2010 03:23 PM, Bartlomiej Zolnierkiewicz wrote:
>
> Hi Dan,
>
> On Tuesday 03 August 2010 05:27:47 pm Dan Carpenter wrote:
>> 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".
>
> You might like to pick up
>
> 	http://patchwork.ozlabs.org/patch/39358/

Picked it up...


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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++;
 			}
 		}
 	}