summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
commit4660d881aaf8ce1cd51f19f7b19c7127cbb5a3a9 (patch)
tree18854ac6c61dc3dbdffe560cf5807364e55fcb15
parent175271be9212360db40711ac3d5a0f16bcd5f4d1 (diff)
downloadqemu-openbios-4660d881aaf8ce1cd51f19f7b19c7127cbb5a3a9.tar.gz
pc_kbd: use instance value to initialise C instance parameter
This simplifies the open word by avoiding having to locate and read the value of the address property. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r--drivers/pc_kbd.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/pc_kbd.c b/drivers/pc_kbd.c
index dfb73bff..a98e57e6 100644
--- a/drivers/pc_kbd.c
+++ b/drivers/pc_kbd.c
@@ -181,15 +181,9 @@ pc_kbd_close(void)
static void
pc_kbd_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;
+ PUSH(find_ih_method("address", my_self()));
+ fword("execute");
+ *address = POP();
RET ( -1 );
}
@@ -285,6 +279,10 @@ ob_pc_kbd_init(const char *path, const char *kdev_name, const char *mdev_name,
fword("property");
BIND_NODE_METHODS(get_cur_dev(), pc_kbd);
+
+ PUSH(offset);
+ feval("value address");
+
fword("finish-device");
snprintf(nodebuff, sizeof(nodebuff), "%s/8042/%s", path, kdev_name);