To librarize flashrom, we have to move away from printf to generic printing functions.
I'd like to classify messages into four severity levels: * Error (out of memory, write failed, ...) * Warning (chipset init incomplete, ...) * Notice (chip detected, flashing successful) * Debug
I also would like to differentiate between controller related and flashchip related messages. E.g. one might be interested in verbose probing output, but not in full SB600 SPI debugging for every command sent. Since all messages above debug level are shown anyway, this differentiation makes most sense if only applied to debug messages. Suggested set of message functions (all with printk syntax): msg_err msg_warn msg_notice msg_debug_controller msg_debug_flash
Progress printing is done with dots, equals, numbers, sometimes with, sometimes without backspace for beautification. Some focus on percentage, others focus on addresses. With a maxval parameter, we can handle policy on a case-by-case basis. Suggested progress bar function: progressbar(int curval, int maxval)
Comments appreciated.
Regards, Carl-Daniel