From patchwork Tue Jun 10 23:53:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 358419 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4E8B314007C for ; Wed, 11 Jun 2014 09:56:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EB1324B58F; Wed, 11 Jun 2014 01:55:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wcLcLmFYRHOO; Wed, 11 Jun 2014 01:55:37 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C03804B5CB; Wed, 11 Jun 2014 01:54:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C23114A05D for ; Wed, 11 Jun 2014 01:54:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gb1bKYdoCNzR for ; Wed, 11 Jun 2014 01:54:16 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ig0-f201.google.com (mail-ig0-f201.google.com [209.85.213.201]) by theia.denx.de (Postfix) with ESMTPS id 4982E4A036 for ; Wed, 11 Jun 2014 01:54:01 +0200 (CEST) Received: by mail-ig0-f201.google.com with SMTP id uq10so12976igb.4 for ; Tue, 10 Jun 2014 16:54:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wHYmXyq62D7w1udMf+qCdNKTsdBKXdwZa/8PZOxymaw=; b=LUfLKvejwsggFM4od7xYIOXFNzEs5wbn1DE4SL8B1UWtd2cTfd0YcSmHuUZCypVPoi /sWSStGFHMVU8TkKwEW6P4t5MF83xp6Kr/2rKifaaRKIUS1GvMMtcShlghEoRIkfxOHM 7uBtzTwpV2ww7SrScrzo/Qo1r3jj85wdZZYj7Sd9qM6cFN69H/yTj/zkVbSjnTtDDpCA qRDqhOHmlsMEcfZ5XzGyCygEfE+p9LKfMC+62NOBCOf5B8g5fPZJJOJWmqKovZopnt4H unC4aW9HDrsV/T2Bm1DHviu+EzNABu8sRcmULlkpezlC8KmzrorbCRx67QJ5Tmvznd3u cx9A== X-Gm-Message-State: ALoCoQnXe4AxIF1J6GXBV+BVaVcn12r74dgY+mRsWOe96CXSt4mX+elgaqomi4Axl69RIP4fE6M1 X-Received: by 10.182.47.199 with SMTP id f7mr1709193obn.6.1402444440584; Tue, 10 Jun 2014 16:54:00 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id z50si1411021yhb.3.2014.06.10.16.54.00 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Jun 2014 16:54:00 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 57C6F5A45C9; Tue, 10 Jun 2014 16:54:00 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 24AB92220B6; Tue, 10 Jun 2014 17:54:00 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 10 Jun 2014 17:53:47 -0600 Message-Id: <1402444428-11356-15-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1402444428-11356-1-git-send-email-sjg@chromium.org> References: <1402444428-11356-1-git-send-email-sjg@chromium.org> Cc: Jon Loeliger , Tom Rini Subject: [U-Boot] [PATCH v5 14/15] dm: Tidy up four minor code nits X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_get_device() function has some errors in its documentation. Fix these problems. Signed-off-by: Simon Glass Acked-by: Marek Vasut --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None include/dm/device.h | 2 +- include/dm/lists.h | 20 ++++++++++++++++++++ include/dm/root.h | 2 +- include/dm/uclass.h | 6 ++++-- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/dm/device.h b/include/dm/device.h index 19f2039..ae75a3f 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -21,7 +21,7 @@ struct driver_info; #define DM_FLAG_ACTIVATED (1 << 0) /* DM is responsible for allocating and freeing platdata */ -#define DM_FLAG_ALLOC_PDATA (2 << 0) +#define DM_FLAG_ALLOC_PDATA (1 << 1) /** * struct udevice - An instance of a driver diff --git a/include/dm/lists.h b/include/dm/lists.h index 7feba4b..49d87e6 100644 --- a/include/dm/lists.h +++ b/include/dm/lists.h @@ -32,8 +32,28 @@ struct driver *lists_driver_lookup_name(const char *name); */ struct uclass_driver *lists_uclass_lookup(enum uclass_id id); +/** + * lists_bind_drivers() - search for and bind all drivers to parent + * + * This searches the U_BOOT_DEVICE() structures and creates new devices for + * each one. The devices will have @parent as their parent. + * + * @parent: parent driver (root) + * @early_only: If true, bind only drivers with the DM_INIT_F flag. If false + * bind all drivers. + */ int lists_bind_drivers(struct udevice *parent); +/** + * lists_bind_fdt() - bind a device tree node + * + * This creates a new device bound to the given device tree node, with + * @parent as its parent. + * + * @parent: parent driver (root) + * @blob: device tree blob + * @offset: offset of this device tree node + */ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset); #endif diff --git a/include/dm/root.h b/include/dm/root.h index 3018bc8..a4826a6 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -41,7 +41,7 @@ int dm_scan_platdata(void); int dm_scan_fdt(const void *blob); /** - * dm_init() - Initialize Driver Model structures + * dm_init() - Initialise Driver Model structures * * This function will initialize roots of driver tree and class tree. * This needs to be called before anything uses the DM diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 931d9c0..0df2e5e 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -96,12 +96,14 @@ int uclass_get(enum uclass_id key, struct uclass **ucp); /** * uclass_get_device() - Get a uclass device based on an ID and index * + * The device is probed to activate it ready for use. + * * id: ID to look up * @index: Device number within that uclass (0=first) - * @ucp: Returns pointer to uclass (there is only one per for each ID) + * devp: Returns pointer to device (there is only one per for each ID) * @return 0 if OK, -ve on error */ -int uclass_get_device(enum uclass_id id, int index, struct udevice **ucp); +int uclass_get_device(enum uclass_id id, int index, struct udevice **devp); /** * uclass_first_device() - Get the first device in a uclass