{"id":812580,"url":"http://patchwork.ozlabs.org/api/patches/812580/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/1505160270-10650-5-git-send-email-philipp.tomsich@theobroma-systems.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505160270-10650-5-git-send-email-philipp.tomsich@theobroma-systems.com>","list_archive_url":null,"date":"2017-09-11T20:04:12","name":"[U-Boot,v3,04/19] dm: core: add dev_read_addr_ptr()","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"1d9097b59ad27ce3212bab2d4bd5d48157383292","submitter":{"id":53488,"url":"http://patchwork.ozlabs.org/api/people/53488/?format=json","name":"Philipp Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"delegate":{"id":69486,"url":"http://patchwork.ozlabs.org/api/users/69486/?format=json","username":"ptomsich","first_name":"Philipp","last_name":"Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/1505160270-10650-5-git-send-email-philipp.tomsich@theobroma-systems.com/mbox/","series":[{"id":2559,"url":"http://patchwork.ozlabs.org/api/series/2559/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=2559","date":"2017-09-11T20:04:11","name":"rockchip: convert the RK3368 to OF_LIVE and validate on the RK3368-uQ7","version":3,"mbox":"http://patchwork.ozlabs.org/series/2559/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812580/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812580/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xrf7L4HDVz9s0Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 06:05:50 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 46DD1C21F6F; Mon, 11 Sep 2017 20:05:21 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id E4988C21F5E;\n\tMon, 11 Sep 2017 20:04:45 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 33B69C21E67; Mon, 11 Sep 2017 20:04:43 +0000 (UTC)","from mail.theobroma-systems.com (vegas.theobroma-systems.com\n\t[144.76.126.164])\n\tby lists.denx.de (Postfix) with ESMTPS id D989EC21E4B\n\tfor <u-boot@lists.denx.de>; Mon, 11 Sep 2017 20:04:42 +0000 (UTC)","from [86.59.122.178] (port=59228 helo=android.lan)\n\tby mail.theobroma-systems.com with esmtpsa\n\t(TLS1.2:RSA_AES_128_CBC_SHA256:128)\n\t(Exim 4.80) (envelope-from <philipp.tomsich@theobroma-systems.com>)\n\tid 1drUwh-0003kn-Pa; Mon, 11 Sep 2017 22:04:40 +0200"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","From":"Philipp Tomsich <philipp.tomsich@theobroma-systems.com>","To":"u-boot@lists.denx.de","Date":"Mon, 11 Sep 2017 22:04:12 +0200","Message-Id":"<1505160270-10650-5-git-send-email-philipp.tomsich@theobroma-systems.com>","X-Mailer":"git-send-email 2.1.4","In-Reply-To":"<1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com>","References":"<1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com>","Cc":"Klaus Goger <klaus.goger@theobroma-systems.com>","Subject":"[U-Boot] [PATCH v3 04/19] dm: core: add dev_read_addr_ptr()","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"The dev_read_addr_ptr() mimics the behaviour of the devfdt_get_addr_ptr(),\nretrieving the first address of the node's reg-property and returning\nit as a pointer (or NULL on failure).\n\nSigned-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>\nAcked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>\n\n---\n\nChanges in v3: None\nChanges in v2:\n- implements the dev_read_addr_ptr() function\n\n drivers/core/read.c |  7 +++++++\n include/dm/read.h   | 15 +++++++++++++++\n 2 files changed, 22 insertions(+)","diff":"diff --git a/drivers/core/read.c b/drivers/core/read.c\nindex 6acb333..065589a 100644\n--- a/drivers/core/read.c\n+++ b/drivers/core/read.c\n@@ -57,6 +57,13 @@ fdt_addr_t dev_read_addr(struct udevice *dev)\n \treturn dev_read_addr_index(dev, 0);\n }\n \n+void *dev_read_addr_ptr(struct udevice *dev)\n+{\n+\tfdt_addr_t addr = dev_read_addr(dev);\n+\n+\treturn (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;\n+}\n+\n fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *property,\n \t\t\t\tfdt_size_t *sizep)\n {\ndiff --git a/include/dm/read.h b/include/dm/read.h\nindex 49d69c9..e7f7125 100644\n--- a/include/dm/read.h\n+++ b/include/dm/read.h\n@@ -113,6 +113,16 @@ fdt_addr_t dev_read_addr_index(struct udevice *dev, int index);\n fdt_addr_t dev_read_addr(struct udevice *dev);\n \n /**\n+ * dev_read_addr_ptr() - Get the reg property of a device\n+ *                       as a pointer\n+ *\n+ * @dev: Device to read from\n+ *\n+ * @return pointer or NULL if not found\n+ */\n+void *dev_read_addr_ptr(struct udevice *dev);\n+\n+/**\n  * dev_read_addr_size() - get address and size from a device property\n  *\n  * This does no address translation. It simply reads an property that contains\n@@ -417,6 +427,11 @@ static inline fdt_addr_t dev_read_addr(struct udevice *dev)\n \treturn devfdt_get_addr(dev);\n }\n \n+static inline void *dev_read_addr_ptr(struct udevice *dev)\n+{\n+\treturn devfdt_get_addr_ptr(dev);\n+}\n+\n static inline fdt_addr_t dev_read_addr_size(struct udevice *dev,\n \t\t\t\t\t    const char *propname,\n \t\t\t\t\t    fdt_size_t *sizep)\n","prefixes":["U-Boot","v3","04/19"]}