]> git.ozlabs.org Git - petitboot/blobdiff - discover/parser-utils.c
discover: fix return value for discover_device_get_param
[petitboot] / discover / parser-utils.c
index a91c33a457760ce31ec57705fef78dfe5b890adf..f4a35a752c8a46f28f3da39f809ddf2c7b4ffc0e 100644 (file)
@@ -4,26 +4,12 @@
 #include <log/log.h>
 #include <talloc/talloc.h>
 
-#include "pb-protocol/pb-protocol.h"
+#include "types/types.h"
+#include "event.h"
 #include "udev.h"
 #include "device-handler.h"
 #include "parser-utils.h"
 
-void device_add_boot_option(struct device *device,
-               struct boot_option *boot_option)
-{
-       pb_log("%s: %s\n", __func__, device->id);
-       pb_log(" id     '%s'\n", boot_option->id);
-       pb_log(" name   '%s'\n", boot_option->name);
-       pb_log(" descr  '%s'\n", boot_option->description);
-       pb_log(" icon   '%s'\n", boot_option->icon_file);
-       pb_log(" image  '%s'\n", boot_option->boot_image_file);
-       pb_log(" initrd '%s'\n", boot_option->initrd_file);
-       pb_log(" args   '%s'\n", boot_option->boot_args);
-       list_add(&device->boot_options, &boot_option->list);
-       talloc_steal(device, boot_option);
-}
-
 const char *generic_icon_file(enum generic_icon_type type)
 {
        switch (type) {
@@ -42,13 +28,13 @@ const char *generic_icon_file(enum generic_icon_type type)
 
 enum generic_icon_type guess_device_type(struct discover_context *ctx)
 {
-       struct udev_event *event;
+       struct event *event;
        const char *type, *bus;
 
        event = ctx->event;
 
-       type = udev_event_param(event, "ID_TYPE");
-       bus = udev_event_param(event, "ID_BUS");
+       type = event_get_param(event, "ID_TYPE");
+       bus = event_get_param(event, "ID_BUS");
 
        if (type && streq(type, "cd"))
                return ICON_TYPE_OPTICAL;