Author: mcayland Date: Mon Aug 4 19:40:31 2014 New Revision: 1309 URL: http://tracker.coreboot.org/trac/openbios/changeset/1309
Log: pc_serial.c: move address initialisation to a separate init word
This is in preparation for making the address attribute optional.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/drivers/pc_serial.c
Modified: trunk/openbios-devel/drivers/pc_serial.c ============================================================================== --- trunk/openbios-devel/drivers/pc_serial.c Mon Aug 4 19:40:28 2014 (r1308) +++ trunk/openbios-devel/drivers/pc_serial.c Mon Aug 4 19:40:31 2014 (r1309) @@ -142,22 +142,19 @@ static void pc_serial_open(unsigned long *address) { - int len; - phandle_t ph; - unsigned long *prop; - - fword("my-self"); - fword("ihandle>phandle"); - ph = (phandle_t)POP(); - prop = (unsigned long *)get_property(ph, "address", &len); - *address = *prop; - RET ( -1 ); }
+static void +pc_serial_init(unsigned long *address) +{ + *address = POP(); +} + DECLARE_UNNAMED_NODE(pc_serial, INSTALL_OPEN, sizeof(unsigned long));
NODE_METHODS(pc_serial) = { + { "init", pc_serial_init }, { "open", pc_serial_open }, { "close", pc_serial_close }, { "read", pc_serial_read }, @@ -177,6 +174,10 @@ push_str(nodebuff); fword("find-device");
+ PUSH(offset); + PUSH(find_package_method("init", get_cur_dev())); + fword("execute"); + push_str("serial"); fword("device-type");