>>>> +/* 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 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot