[PATCH 1/2] Fix error checking in Vitesse IRQ config

Andy Fleming afleming at freescale.com
Thu Jul 19 04:52:52 EST 2007


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

> On 7/18/07, Andy Fleming <afleming at 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



More information about the Linuxppc-dev mailing list