path: root/discover/device-handler.c
diff options
authorJeremy Kerr <>2016-12-12 19:58:32 +0800
committerSamuel Mendoza-Jonas <>2016-12-20 16:40:21 +1100
commit4563c5d672f605c493996a652b9e3e588a8596dd (patch)
tree6d835e9278d4f2d4021113bfa4b1f32366865150 /discover/device-handler.c
parentbdd5c29b008a4484ed141f934d97465d673a10b7 (diff)
discover: add handler reference to struct discover_context
Since the device handler provides the status message functions, we need a pointer to it for device discovery (which we use a struct discover_context for). This change adds a 'handler' member to struct discover_context, to allow status reporting. Since we now have a handler, there's no need for the network pointer, so provide an accessor function instead. Signed-off-by: Jeremy Kerr <> Signed-off-by: Samuel Mendoza-Jonas <>
Diffstat (limited to 'discover/device-handler.c')
1 files changed, 7 insertions, 1 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index af7918b..f8b7bf5 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -114,6 +114,12 @@ const struct discover_device *device_handler_get_device(
return handler->devices[index];
+struct network *device_handler_get_network(
+ const struct device_handler *handler)
+ return handler->network;
struct discover_boot_option *discover_boot_option_create(
struct discover_context *ctx,
struct discover_device *device)
@@ -788,8 +794,8 @@ struct discover_context *device_handler_discover_context_create(
struct discover_context *ctx;
ctx = talloc_zero(handler, struct discover_context);
+ ctx->handler = handler;
ctx->device = device;
- ctx->network = handler->network;
return ctx;
OpenPOWER on IntegriCloud