[U-Boot] [PATCH 01/13] davinci_emac: move arch-independent defines to separate header

Igor Grinberg grinberg at compulab.co.il
Thu Dec 8 15:33:25 CET 2011


On 12/08/11 01:48, Ilya Yanok wrote:
> Hi Igor,
> 
> sorry for the late answer.
> 
> On 30.11.2011 11:42, Igor Grinberg wrote:
>>> diff --git a/arch/arm/cpu/arm926ejs/davinci/dp83848.c b/arch/arm/cpu/arm926ejs/davinci/dp83848.c
>>> index c71c685..d435e4b 100644
>>> --- a/arch/arm/cpu/arm926ejs/davinci/dp83848.c
>>> +++ b/arch/arm/cpu/arm926ejs/davinci/dp83848.c
>>> @@ -29,6 +29,7 @@
>>>  #include <net.h>
>>>  #include <dp83848.h>
>>>  #include <asm/arch/emac_defs.h>
>>> +#include "../../../../../drivers/net/davinci_emac.h"
>>
>> Doesn't this look terrible?
> 
> Yes, it does. But this will be removed once someone will switch the
> driver to phylib.

Hmmm... and who will be that someone?
Is it on someone's TODO list?

> 
>> I'd suggest, to split the davinci_emac.h to driver private part
>> (if there is) and to public part.
>> Then put the public part into the include/ directory - just as,
>> for example, dm9000 does.
> 
> Uh.. As for me, polluting the public includes is not very good idea as
> well.

Why is that? If you need the functionality used outside of the
drivers/net directory, then I think it is the way.
To reduce the garbage in include/ it can be split into subdirs,
so for example all network related .h files will reside in include/net/

> And again I think switching to phylib use is the right solution.
> This should be rather simple.

Agreed, but if you still see this ugly thing in a year or so,
it will mean that you just merged ugly code with hope that it will
be fixed some day and it has been a year already, right?

Instead, my proposed solution will not prevent switching
to phylib, but will still look better even if that someone
(who supposed to do the switch) will not switch the driver to phylib.
Unless, you want it to look ugly, so that someone will hurry up...

If it is so painful for you to use my proposed solution or
you think it is worth than the current one, you can merge this.
I don't really want to block it.


-- 
Regards,
Igor.


More information about the U-Boot mailing list