On Thu, 25 Jul 2019, Mark Cave-Ayland wrote:
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
drivers/usbhid.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/usbhid.c b/drivers/usbhid.c index 1c13113..fdf9711 100644 --- a/drivers/usbhid.c +++ b/drivers/usbhid.c @@ -39,7 +39,7 @@ #include "drivers/usb.h" #include "usb.h"
-DECLARE_UNNAMED_NODE(usb_kbd, INSTALL_OPEN, sizeof(int)); +DECLARE_UNNAMED_NODE(usb_kbd, 0, sizeof(int));
static void keyboard_open(int *idx) @@ -564,16 +564,23 @@ void ob_usb_hid_add_keyboard(const char *path) char name[128]; phandle_t aliases;
- snprintf(name, sizeof(name), "%s/keyboard", path);
- usb_debug("Found keyboard at %s\n", name);
- REGISTER_NAMED_NODE(usb_kbd, name);
- push_str(name);
push_str(path); fword("find-device");
fword("new-device");
push_str("keyboard");
fword("device-name");
push_str("keyboard"); fword("device-type");
usb_debug("Found keyboard at %s\n", name);
Does name contain anything here other than garbage? Shouldn't this debug printf now be moved after the snprintf below like it was originally or print path instead of name?
Regards, BALATON Zoltan
- BIND_NODE_METHODS(get_cur_dev(), usb_kbd);
- fword("finish-device");
- aliases = find_dev("/aliases");
- snprintf(name, sizeof(name), "%s/keyboard", path); set_property(aliases, "keyboard", name, strlen(name) + 1);
}