linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Fix error checking in Vitesse IRQ config
@ 2007-07-18  6:35 Andy Fleming
  2007-07-18  7:00 ` pradeep singh
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andy Fleming @ 2007-07-18  6:35 UTC (permalink / raw)
  To: netdev, linuxppc-dev

phy_read() returns a negative number if there's an error, but the
error-checking code in the Vitesse driver's config_intr function
triggers if phy_read() returns non-zero.  Correct that.

Signed-off-by: Andy Fleming <afleming@freescale.com>
---
I made a really stupid mistake in the 4 patches I sent out, earlier.  I
thought those patches had been tested, but they hadn't been.  This one
corrects a tiny error in the patch, and they have now been tested.  As before
this change can be pulled from:

http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev

Really, REALLY sorry about that.  I have been given a paper bag of appropriate
size and shape to fit over my head.

 drivers/net/phy/vitesse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index 6a53856..8874497 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -109,7 +109,7 @@ static int vsc824x_config_intr(struct phy_device *phydev)
 		 */
 		err = phy_read(phydev, MII_VSC8244_ISTAT);
 
-		if (err)
+		if (err < 0)
 			return err;
 
 		err = phy_write(phydev, MII_VSC8244_IMASK, 0);
-- 
1.5.0.2.230.gfbe3d-dirty

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

* Re: [PATCH 1/2] Fix error checking in Vitesse IRQ config
  2007-07-18  6:35 [PATCH 1/2] Fix error checking in Vitesse IRQ config Andy Fleming
@ 2007-07-18  7:00 ` pradeep singh
  2007-07-18 18:52   ` Andy Fleming
  2007-07-19 16:49 ` Jon Loeliger
  2007-07-19 19:57 ` Kumar Gala
  2 siblings, 1 reply; 5+ messages in thread
From: pradeep singh @ 2007-07-18  7:00 UTC (permalink / raw)
  To: Andy Fleming; +Cc: netdev, linuxppc-dev

On 7/18/07, Andy Fleming <afleming@freescale.com> wrote:
> phy_read() returns a negative number if there's an error, but the
> error-checking code in the Vitesse driver's config_intr function
> triggers if phy_read() returns non-zero.  Correct that.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
> I made a really stupid mistake in the 4 patches I sent out, earlier.  I
> thought those patches had been tested, but they hadn't been.  This one
> corrects a tiny error in the patch, and they have now been tested.  As before
> this change can be pulled from:
>
> http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev
>
> Really, REALLY sorry about that.  I have been given a paper bag of appropriate
> size and shape to fit over my head.
>
>  drivers/net/phy/vitesse.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
> index 6a53856..8874497 100644
> --- a/drivers/net/phy/vitesse.c
> +++ b/drivers/net/phy/vitesse.c
> @@ -109,7 +109,7 @@ static int vsc824x_config_intr(struct phy_device *phydev)
>                  */
>                 err = phy_read(phydev, MII_VSC8244_ISTAT);
>
> -               if (err)
> +               if (err < 0)
>                         return err;

but would that mean, if phy_read returns > 0 it is a success?

thanks
>
>                 err = phy_write(phydev, MII_VSC8244_IMASK, 0);
> --
> 1.5.0.2.230.gfbe3d-dirty
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
Pradeep

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

* Re: [PATCH 1/2] Fix error checking in Vitesse IRQ config
  2007-07-18  7:00 ` pradeep singh
@ 2007-07-18 18:52   ` Andy Fleming
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Fleming @ 2007-07-18 18:52 UTC (permalink / raw)
  To: pradeep singh; +Cc: netdev, linuxppc-dev


On Jul 18, 2007, at 02:00, pradeep singh wrote:

> On 7/18/07, Andy Fleming <afleming@freescale.com> wrote:

>> -               if (err)
>> +               if (err < 0)
>>                         return err;
>
> but would that mean, if phy_read returns > 0 it is a success?

Yes.  phy_read() returns a 32-bit value.  If there's an error, it  
returns a negative number.  If not, it returns whatever was in the  
register (which is only 16 bits)

phy_write() returns 0 on success, and non-zero, otherwise.  In  
hindsight, it would have been better to be consistent.

Andy

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

* Re: [PATCH 1/2] Fix error checking in Vitesse IRQ config
  2007-07-18  6:35 [PATCH 1/2] Fix error checking in Vitesse IRQ config Andy Fleming
  2007-07-18  7:00 ` pradeep singh
@ 2007-07-19 16:49 ` Jon Loeliger
  2007-07-19 19:57 ` Kumar Gala
  2 siblings, 0 replies; 5+ messages in thread
From: Jon Loeliger @ 2007-07-19 16:49 UTC (permalink / raw)
  To: Andy Fleming; +Cc: netdev, linuxppc-dev@ozlabs.org

On Wed, 2007-07-18 at 01:35, Andy Fleming wrote:
> phy_read() returns a negative number if there's an error, but the
> error-checking code in the Vitesse driver's config_intr function
> triggers if phy_read() returns non-zero.  Correct that.
> 
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
> I made a really stupid mistake in the 4 patches I sent out, earlier.  I
> thought those patches had been tested, but they hadn't been.  This one
> corrects a tiny error in the patch, and they have now been tested.  As before
> this change can be pulled from:
> 
> http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev
> 
> Really, REALLY sorry about that.  I have been given a paper bag of appropriate
> size and shape to fit over my head.
> 
>  drivers/net/phy/vitesse.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
> index 6a53856..8874497 100644


Acked-by: Jon Loeliger <jdl@freescale.com>

Tested on the 8641HPCN.

Thanks,
jdl

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

* Re: [PATCH 1/2] Fix error checking in Vitesse IRQ config
  2007-07-18  6:35 [PATCH 1/2] Fix error checking in Vitesse IRQ config Andy Fleming
  2007-07-18  7:00 ` pradeep singh
  2007-07-19 16:49 ` Jon Loeliger
@ 2007-07-19 19:57 ` Kumar Gala
  2 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2007-07-19 19:57 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linuxppc-dev@ozlabs.org list


On Jul 18, 2007, at 1:35 AM, Andy Fleming wrote:

> phy_read() returns a negative number if there's an error, but the
> error-checking code in the Vitesse driver's config_intr function
> triggers if phy_read() returns non-zero.  Correct that.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>

Jeff,

Can you make sure to send this to linus since its need to properly  
fix the Vitesse phy's used on the 8641HPCN and 8544 DS boards.

thanks

- k

> ---
> I made a really stupid mistake in the 4 patches I sent out,  
> earlier.  I
> thought those patches had been tested, but they hadn't been.  This one
> corrects a tiny error in the patch, and they have now been tested.   
> As before
> this change can be pulled from:
>
> http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev
>
> Really, REALLY sorry about that.  I have been given a paper bag of  
> appropriate
> size and shape to fit over my head.
>
>  drivers/net/phy/vitesse.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
> index 6a53856..8874497 100644
> --- a/drivers/net/phy/vitesse.c
> +++ b/drivers/net/phy/vitesse.c
> @@ -109,7 +109,7 @@ static int vsc824x_config_intr(struct  
> phy_device *phydev)
>  		 */
>  		err = phy_read(phydev, MII_VSC8244_ISTAT);
>
> -		if (err)
> +		if (err < 0)
>  			return err;
>
>  		err = phy_write(phydev, MII_VSC8244_IMASK, 0);
> -- 
> 1.5.0.2.230.gfbe3d-dirty
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2007-07-19 19:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18  6:35 [PATCH 1/2] Fix error checking in Vitesse IRQ config Andy Fleming
2007-07-18  7:00 ` pradeep singh
2007-07-18 18:52   ` Andy Fleming
2007-07-19 16:49 ` Jon Loeliger
2007-07-19 19:57 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).