From patchwork Thu Sep 11 11:22:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 37241 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3756A20491 for ; Thu, 11 Sep 2014 11:23:19 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf95614265obc.0 for ; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=HdLK0ndsMJRQ7bt93bjztF1rF6EKxmHNuA1xm2Yxfb4=; b=E9b5ItvIUqVR3hgTwame3kFmPEJyAgDch04vzeGGYvPaA0gqjTr/Av9Nmwb3Gyw6wO IgCS04JkNRQvvdRjhJHdew2Li8OIVtYfryJVs7HTTkzdmDZpbiPVjUBEmN97ZUK8irfR m3wLiTNT8uYgpYihumElKHgbwf3CpTRu0A8K6bvcF16mwMTAonGe0EUpSTT43CznAZOl Xq5jM9c/yG50DiBWdgJPPI2xpqFW6g8u7Kqhn7PyTl/Eeyu3n3XOkazwGhW0I75seGXU b2BejKqHH9f0vN+DmhWEnIKujNKaph7Sc8hZs5t+Sb70QdnDXhLNlXkMh8Shs2cOqTHj ijQQ== X-Gm-Message-State: ALoCoQnzZp10G2CHbXZ72DsY4yYMEKK+JFgnUYFvlfF/KlH4+MDfxkWmJ/AFDPuVv4Y6l4SG30mw X-Received: by 10.182.102.34 with SMTP id fl2mr175406obb.16.1410434598780; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.242 with SMTP id 105ls146526qgx.17.gmail; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) X-Received: by 10.220.161.136 with SMTP id r8mr116140vcx.21.1410434598639; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id ts8si184677vdc.34.2014.09.11.04.23.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 04:23:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so6289916vcb.17 for ; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) X-Received: by 10.221.26.70 with SMTP id rl6mr200973vcb.0.1410434598549; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp574639vcb; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) X-Received: by 10.224.89.10 with SMTP id c10mr286954qam.51.1410434598100; Thu, 11 Sep 2014 04:23:18 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id m6si500715qaa.127.2014.09.11.04.23.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Sep 2014 04:23:18 -0700 (PDT) Received-SPF: none (google.com: linaro-mm-sig-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XS2T3-0002uS-Ae; Thu, 11 Sep 2014 11:23:13 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XS2Sm-0002o8-M2 for linaro-mm-sig@lists.linaro.org; Thu, 11 Sep 2014 11:22:56 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBQ00GCKIERT320@mailout2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 11 Sep 2014 12:25:40 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-3c-54118608e664 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 6D.F0.25543.80681145; Thu, 11 Sep 2014 12:22:48 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NBQ00CY7I9W7RA0@eusync3.samsung.com>; Thu, 11 Sep 2014 12:22:48 +0100 (BST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Thu, 11 Sep 2014 13:22:39 +0200 Message-id: <1410434561-9294-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1410434561-9294-1-git-send-email-m.szyprowski@samsung.com> References: <1410434561-9294-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t/xq7ocbYIhBj/OyVvMWb+GzeLvpGPs Fgf+7GC0WNndzGaxc907RouzTW/YLbZ3zmC3+HLlIZPFpsfXWC0u75rDZrH2yF12iwXHW1gd eDx+/5rE6HG5r5fJo+vtFSaPO9f2sHmcmPGbxWPzknqP2/8eM3us+/OKyaNvyypGj8+b5AK4 orhsUlJzMstSi/TtErgyrh+9w1iwWLii69dhlgbGRQJdjJwcEgImEpcaPrFC2GISF+6tZ+ti 5OIQEljKKPH85iEop49J4tujD+wgVWwChhJdb7vYQGwRATeJf+sgipgFJjNLXFu4hwkkISwQ JrHq2B0wm0VAVWL11wssXYwcHLwC7hJXT0pDbJOT+P9yBVgJp4CHxORvk8DmCwGVXNy9gW0C I+8CRoZVjKKppckFxUnpuYZ6xYm5xaV56XrJ+bmbGCGB+2UH4+JjVocYBTgYlXh4Cy/yhwix JpYVV+YeYpTgYFYS4S0tFAwR4k1JrKxKLcqPLyrNSS0+xMjEwSnVwLjsZM9F3SYm6ct1OTH/ 7k+/EW/btn1b6vK82lxj9t1rpC+zFLQ+LVAoTL6rtGei2v9tL7yaTpg03bDVdQuO7nN8orn3 4Ip5Am3qEWnBWzcGzd1hMzWoYcfR6KiOtmPHsgqr5yz7Kq/p+ix/ffTFs4occzdte3RGvuj0 KfEjS9bOMLlue98wXkmJpTgj0VCLuag4EQDVQPmiOgIAAA== Cc: Arnd Bergmann , Josh Cartwright , Michal Nazarewicz , linaro-mm-sig@lists.linaro.org, Kyungmin Park , Grant Likely , Andrew Morton , Joonsoo Kim Subject: [Linaro-mm-sig] [PATCH v2 1/3] drivers: of: add return value to of_reserved_mem_device_init X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-mm-sig-bounces@lists.linaro.org Sender: linaro-mm-sig-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Driver calling of_reserved_mem_device_init() might be interested if the initialization has been successful or not, so add support for returning error code. Signed-off-by: Marek Szyprowski --- drivers/of/of_reserved_mem.c | 3 ++- include/linux/of_reserved_mem.h | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 59fb12e..7e7de03 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -243,7 +243,7 @@ static inline struct reserved_mem *__find_rmem(struct device_node *node) * This function assign memory region pointed by "memory-region" device tree * property to the given device. */ -void of_reserved_mem_device_init(struct device *dev) +int of_reserved_mem_device_init(struct device *dev) { struct reserved_mem *rmem; struct device_node *np; @@ -260,6 +260,7 @@ void of_reserved_mem_device_init(struct device *dev) rmem->ops->device_init(rmem, dev); dev_info(dev, "assigned reserved memory node %s\n", rmem->name); + return 0; } /** diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h index 5b5efae..ad2f670 100644 --- a/include/linux/of_reserved_mem.h +++ b/include/linux/of_reserved_mem.h @@ -16,7 +16,7 @@ struct reserved_mem { }; struct reserved_mem_ops { - void (*device_init)(struct reserved_mem *rmem, + int (*device_init)(struct reserved_mem *rmem, struct device *dev); void (*device_release)(struct reserved_mem *rmem, struct device *dev); @@ -28,14 +28,17 @@ typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem); _OF_DECLARE(reservedmem, name, compat, init, reservedmem_of_init_fn) #ifdef CONFIG_OF_RESERVED_MEM -void of_reserved_mem_device_init(struct device *dev); +int of_reserved_mem_device_init(struct device *dev); void of_reserved_mem_device_release(struct device *dev); void fdt_init_reserved_mem(void); void fdt_reserved_mem_save_node(unsigned long node, const char *uname, phys_addr_t base, phys_addr_t size); #else -static inline void of_reserved_mem_device_init(struct device *dev) { } +static inline int of_reserved_mem_device_init(struct device *dev) +{ + return -ENOSYS; +} static inline void of_reserved_mem_device_release(struct device *pdev) { } static inline void fdt_init_reserved_mem(void) { }