From patchwork Mon Apr 13 01:11:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 25878 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 71A98DE20A for ; Mon, 13 Apr 2009 11:17:11 +1000 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from hera.kernel.org (hera.kernel.org [140.211.167.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 54242DE17A; Mon, 13 Apr 2009 11:15:44 +1000 (EST) Received: from hera.kernel.org (IDENT:U2FsdGVkX1/hFYyPSjCSKlJjqFdXTchkjk3jP0eBKTI@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n3D1FcSX006351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Apr 2009 01:15:38 GMT Received: (from geoff@localhost) by hera.kernel.org (8.14.2/8.13.1/Submit) id n3D1FbRf006350; Mon, 13 Apr 2009 01:15:37 GMT Message-Id: <20090413011137.172092821@am.sony.com> References: <20090413011136.475152916@am.sony.com> In-Reply-To: <20090413011136.475152916@am.sony.com> User-Agent: quilt/0.46-1 Date: Sun, 12 Apr 2009 18:11:45 -0700 From: Geoff Levand To: Jeremy Kerr Content-Disposition: inline; filename=discover-remove-test-code.diff X-Virus-Scanned: ClamAV 0.93.3/9226/Sun Apr 12 20:02:45 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Mon, 13 Apr 2009 01:15:39 +0000 (UTC) Cc: cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [patch 09/24] petitboot: Remove device handler test code X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Remove the test code from device-handler.c and hookup handler.devices and handler.n_devices in device_handler_get_current_devices(). Signed-off-by: Geoff Levand --- discover/device-handler.c | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -35,31 +35,11 @@ struct mount_map { char *mount_point; }; - -static struct boot_option options[] = { - { - .id = "1.1", - .name = "meep one", - .description = "meep description one", - .icon_file = "meep.one.png", - .boot_args = "root=/dev/sda1", - }, -}; - -static struct device device = { - .id = "1", - .name = "meep", - .description = "meep description", - .icon_file = "meep.png", -}; - -int device_handler_get_current_devices( - struct device_handler *handler __attribute__((unused)), - const struct device **devices) - +int device_handler_get_current_devices(struct device_handler *handler, + const struct device **devices) { - *devices = &device; - return 1; + *devices = handler->devices; + return handler->n_devices; } static int mkdir_recursive(const char *dir) @@ -286,7 +266,6 @@ static struct discover_context *find_con return NULL; } - static int destroy_context(void *arg) { struct discover_context *ctx = arg; @@ -380,7 +359,6 @@ int device_handler_event(struct device_h struct device_handler *device_handler_init(struct discover_server *server) { struct device_handler *handler; - unsigned int i; handler = talloc(NULL, struct device_handler); handler->devices = NULL; @@ -392,12 +370,6 @@ struct device_handler *device_handler_in /* set up our mount point base */ mkdir_recursive(mount_base()); - /* setup out test objects */ - list_init(&device.boot_options); - - for (i = 0; i < sizeof(options) / sizeof(options[0]); i++) - list_add(&device.boot_options, &options[i].list); - parser_init(); return handler; @@ -407,4 +379,3 @@ void device_handler_destroy(struct devic { talloc_free(handler); } -