]> git.ozlabs.org Git - petitboot/blobdiff - discover/resource.c
discover: Always associate resources with a boot option
[petitboot] / discover / resource.c
index 964c1a4d40f78b68ff922980a86c930e699cc3db..b31a215b39be8b345e46abe97fcb1c2ae16387de 100644 (file)
@@ -41,7 +41,7 @@ static void resolve_devpath_against_device(struct resource *res,
        res->resolved = true;
 }
 
-struct resource *create_devpath_resource(void *ctx,
+struct resource *create_devpath_resource(struct discover_boot_option *opt,
        struct discover_device *orig_device,
        const char *devpath)
 {
@@ -50,7 +50,7 @@ struct resource *create_devpath_resource(void *ctx,
        struct resource *res;
        struct pb_url *url;
 
-       res = talloc(ctx, struct resource);
+       res = talloc(opt, struct resource);
 
        pos = strchr(devpath, ':');
 
@@ -112,11 +112,12 @@ bool resolve_devpath_resource(struct device_handler *handler,
        return true;
 }
 
-struct resource *create_url_resource(void *ctx, struct pb_url *url)
+struct resource *create_url_resource(struct discover_boot_option *opt,
+               struct pb_url *url)
 {
        struct resource *res;
 
-       res = talloc(ctx, struct resource);
+       res = talloc(opt, struct resource);
        res->url = url;
        res->resolved = true;