OK, I think I patched in the wrong place.

Sonic 

>-----Original Message-----
>From: Robin Getz [mailto:[email protected]] 
>Sent: Tuesday, March 30, 2010 12:42 AM
>To: [email protected]
>Cc: [email protected]
>Subject: Re: [Linux-kernel-commits] [8566] 
>trunk/drivers/net/bfin_mac.c: Fix bug[#5852] Platform driver 
>probe function returns 0 if fails.
>
>On Mon 29 Mar 2010 05:02, [email protected] pondered:
>> Revision
>> 
>8566<http://blackfin.uclinux.org/gf/project/linux-kernel/scmsvn/?actio
>> n=browse&path=/&view=rev&root=linux-kernel&revision=8566>
>> Author
>> sonicz<http://blackfin.uclinux.org/gf/user/sonicz/>
>> Date
>> 2010-03-29 05:02:32 -0400 (Mon, 29 Mar 2010) Log Message
>> 
>> Fix bug[#5852]<http://blackfin.uclinux.org/gf/tracker/5852> 
>Platform driver probe function returns 0 if fails.
>> 
>> Modified Paths
>> 
>>  *   trunk/drivers/net/bfin_mac.c
>> 
>> Diff
>> Modified: trunk/drivers/net/bfin_mac.c (8565 => 8566)
>> 
>> 
>> --- trunk/drivers/net/bfin_mac.c        2010-03-29 06:37:17 
>UTC (rev 8565)
>> +++ trunk/drivers/net/bfin_mac.c        2010-03-29 09:02:32 
>UTC (rev 8566)
>> @@ -1665,7 +1665,8 @@
>>  {
>>         int ret;
>>         ret = platform_driver_register(&bfin_mii_bus_driver);
>> -       if (!ret)
>> +       /* platform driver probe function returns 0 if fails */
>> +       if (ret)
>>                 return platform_driver_register(&bfin_mac_driver);
>>         return -ENODEV;
>>  }
>
>Are you sure? I looked and the logic appears like 0 means no 
>error (it worked).
>
>with your change, I get no ethernet on 537-stamp.
>
>root:/> ifconfig eth0
>ifconfig: eth0: error fetching interface information: Device not found
>
>If I revert your change, things work...
>
>This is a little more verbose, and tells you what is failing.
>
>===================================================================
>--- drivers/net/bfin_mac.c      (revision 8572)
>+++ drivers/net/bfin_mac.c      (working copy)
>@@ -1665,10 +1665,18 @@
> {
>        int ret;
>        ret = platform_driver_register(&bfin_mii_bus_driver);
>-       /* platform driver probe function returns 0 if fails */
>-       if (ret)
>-               return platform_driver_register(&bfin_mac_driver);
>-       return -ENODEV;
>+       if (ret) {
>+               pr_notice(DRV_NAME "Can't register mii_bus_driver\n");
>+               return -ENODEV;
>+       }
>+
>+       ret = platform_driver_register(&bfin_mac_driver);
>+       if (ret) {
>+               pr_notice(DRV_NAME "Can't register bfin_mac_driver\n");
>+               return -ENODEV;
>+       }
>+
>+       return ret;
> }
>
>
>-Robin
>
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to