On 10/31/2012 07:34 PM, Martin Sucha wrote: > Hi Jakub, > > On Tuesday 30 October 2012 11:23:21 Jakub Jermar wrote: >> On 30.10.2012 0:22, Martin Sucha wrote: >>> lp:~martin-sucha/helenos/kernel-serial >>> This branch contains updates to ns16550 kernel serial driver and code to >>> use it for I/O (for kernel console) on ia32 and amd64 platforms. >>> >>> If you have any comments or suggestions before I merge them, please let >>> me know. >> >> For the record, my concern on the IRC was that now the ns16550 driver >> API is asymmetric. The device is both an indev_t and outdev_t, but >> ns16550_init() takes care only of the indev_t half. The outdev_t part is >> artificially initialized on the first invocation of ns16550_output() for >> the given instance. >> >> There are several options here. We can aim for complete split of the >> input/output part like in the dslrn driver, or can just provide separate >> init()'s for the input and the output parts, but let them share the >> instance. Or keep the single init(), but pass it some arguments that >> would specify what parts to initialize. > I implemented the third option.
I may be becoming slightly biased, but it still feels asymmetric. Why not simply pass ns16550_init() one of the following combinations of flags: NS16550_INPUT NS16550_OUTPUT NS16550_INPUT | NS16550_OUTPUT depending on what you want to have. Let both both ns16550->input and ns16550->output exist and be accessed in exactly the same way, with the possibility of either being NULL, subject to how the instance was initialized. Jakub _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
