[U-Boot] [PATCH 1/3] Initial mflash support

unsik Kim donari75 at gmail.com
Wed Feb 18 04:32:02 CET 2009


>>>> +/* must override this function */
>>>> +struct mg_drv_data * __attribute__((weak)) mg_get_drv_data (void)
>>>> +{
>>>> +	puts ("### WARNING ### port mg_get_drv_data function\n");
>>>> +	return NULL;
>>>> +}
>>> please do an compile error not a run time error
>> IMHO, compile error (or warning) is not a good choice for this case.
> sorry no beacause everyone does not have the board to test it, a compile error
> will at least help use to check if we brake the board or not
Ok, I understand.
>> Compile time error always generate error even though override function
>> exist.
> not necessarely
> does you driver allow multiple instance of mflash?
> if no you does not implement the function
mflash driver doesn't use multiple instance.
I can't understand your thought exactly.

If I remove mg_get_drv_data() default weak function and just add weak attribute
to it's prototype, build works well but it's logically same as original one.
User still don't get any information at build time.

Do you want to just leave mg_get_drv_data() to unresolved symbol ?
If user does not port it, link error will be generate. Is it U-boot's driver
policy ?

Regards,
unsik Kim







More information about the U-Boot mailing list