
Dear Simon Glass,
Hi Marek,
On Thu, Dec 6, 2012 at 10:02 AM, Marek Vasut marex@denx.de wrote:
Dear Simon Glass,
[...]
[...]
error output should be really puts() or printf() ...
Ick that bloats the code badly for an uncommon case. Would really prefer to avoid this.
What do you mean? Are you saying this debug() is correct and this is triggered often? How come?
I mean that debug() in a driver does not generate any code unless DEBUG is defined in that module. The way I do it is when I have a problem in a module I define DEBUG there, which makes all the messages work. But then in the normal case (when not debugging) the code size is not bloated by messages.
So I much prefer debug() to printf() for uncommon messages in drivers, etc.
That's true ... and you're right if the FDT is correct, this will all work well. Ok, whichever way works for me.
You can also use errno.h instead of -1.
True, it might help debugging, although many times it is hard to map the error onto a suitable number designed for Linux. This 'return -1' is pretty common in U-Boot (generic error).
I know, but it'd be nice if this changed. Just a suggestion.
Yes agreed. I recently had a driver which could fail in about 12 different places (different stages of hardware init), so I just created an enum for 12 errors. It wouldn't have been sensible in that case to try and fail to map those onto the errno errors, but in many cases (with fewer error conditions) it would be useful.
Yup
Best regards, Marek Vasut