From patchwork Tue Aug 26 12:09:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 36008 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 833B02054F for ; Tue, 26 Aug 2014 12:14:12 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf122818367pac.11 for ; Tue, 26 Aug 2014 05:14:11 -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=FCUH0YkE8KOVsUv72qUwjdBMPyjyUhG80wU5H4sz0qg=; b=KlhU5ft/wwlwqbG6rPFD6bOy9bfaAmPI7Tz/+wJYsWP+jHvX7rBX6O9jCvy9eVHnMl ILMklYjbx/5pCnkvDceUEyVnoez+DXd58mFvJxiw0YakOcF9pHf+l9+EH+iu3xL/6VOJ J2NqToeZXwFbrEG1osa0B9zT8GSRyGHK6y4+8Td9KogtHeVVPfX+pjE2wxuCPD41FCNv keTjiq88EF1ai6fhPY+hzHHGLweycqVgn5ZzN2zkttWdC72IrVv1B8jaiWKwLd4HE6xV VwTrs+F6CJnZwz9kqDjSvpL3zrPW05hLUuALCjT0OqFvLSzydGTZFXkjK7SEfWopKfYL vZ0Q== X-Gm-Message-State: ALoCoQkqvko8KHKz0OLwZTiU0Wa4JGXO0ErTCyo6CpVGTckdPudA+GrePNzKfIZkeUxCNa7QxTs0 X-Received: by 10.68.116.42 with SMTP id jt10mr17819454pbb.5.1409055251838; Tue, 26 Aug 2014 05:14:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.200 with SMTP id 66ls761869qgl.75.gmail; Tue, 26 Aug 2014 05:14:11 -0700 (PDT) X-Received: by 10.52.227.72 with SMTP id ry8mr333988vdc.64.1409055251652; Tue, 26 Aug 2014 05:14:11 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id h4si1285166vdx.8.2014.08.26.05.14.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:14:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hy4so16364820vcb.22 for ; Tue, 26 Aug 2014 05:14:11 -0700 (PDT) X-Received: by 10.52.147.15 with SMTP id tg15mr869912vdb.53.1409055251526; Tue, 26 Aug 2014 05:14:11 -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 uj3csp193557vcb; Tue, 26 Aug 2014 05:14:11 -0700 (PDT) X-Received: by 10.140.102.142 with SMTP id w14mr41615528qge.101.1409055251050; Tue, 26 Aug 2014 05:14:11 -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 v2si3520883qar.74.2014.08.26.05.14.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 26 Aug 2014 05:14:11 -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 1XMFdZ-0007Cw-PW; Tue, 26 Aug 2014 12:14:09 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XMFdN-0007C7-RL for linaro-mm-sig@lists.linaro.org; Tue, 26 Aug 2014 12:13:57 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAW00CSIY3YJH00@mailout1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 26 Aug 2014 13:16:46 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-7c-53fc79fe7225 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 7C.48.25543.EF97CF35; Tue, 26 Aug 2014 13:13:50 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NAW00F45XYW5O50@eusync4.samsung.com>; Tue, 26 Aug 2014 13:13:50 +0100 (BST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Date: Tue, 26 Aug 2014 14:09:42 +0200 Message-id: <1409054988-32758-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1409054988-32758-1-git-send-email-m.szyprowski@samsung.com> References: <1409054988-32758-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNLMWRmVeSWpSXmKPExsVy+t/xa7r/Kv8EGzSf1bD4O+kYu8WBPzsY LVZ2N7NZ7Fz3jtHibNMbdovtnTPYLb5cechksenxNVaLy7vmsFn0bNjKajHj/D4mi7VH7rJb LDjewmqxfsZrFgc+j9+/JjF6XO7rZfLoenuFyePOtT1sHpuX1Hvc/veY2WPdn1dMHn1bVjF6 fN4kF8AZxWWTkpqTWZZapG+XwJUxs28Hc8F24Ypnc5exNjBuE+hi5OSQEDCRmHHxEiuELSZx 4d56ti5GLg4hgaWMEhcbpjJDOH1MEn/W3mcCqWITMJToetvFBmKLCGRL/Pg2mQXEZhZYyiwx b5YUiC0sECxx9MokZhCbRUBV4m7bdbB6XgEPiRUvnjFCbJOT+P9yBdBMDg5OAU+Jc1OqQcJC QCUbp79nmcDIu4CRYRWjaGppckFxUnquoV5xYm5xaV66XnJ+7iZGSAB/2cG4+JjVIUYBDkYl Ht4PJb+DhVgTy4orcw8xSnAwK4nw/kj6EyzEm5JYWZValB9fVJqTWnyIkYmDU6qBcfXT1l7P zNu3G3Wj/z+sm/vDXTHmLE/aCZH1rFN1d762q0rque68nMXy1Kljh9XeP5uy9tu38t0RbnuT Fx2fGrDgeMAdxcSAva9vr+4OSs2LUDLrCpmjcML6vsNCEXYvRU/JPd8uChx2jpwZu3/SvMgy p58MbxN+PO2q5tmf4ftyv13BXA+2D0osxRmJhlrMRcWJAPm1ivE+AgAA Cc: Arnd Bergmann , Tomasz Figa , Michal Nazarewicz , linaro-mm-sig@lists.linaro.org, Kyungmin Park , Grant Likely , Joonsoo Kim , Josh Cartwright , linux-media@vger.kernel.org Subject: [Linaro-mm-sig] [PATCH 1/7] 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.177 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 59fb12e84e6b..7e7de03585f9 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 5b5efae09135..ad2f67054372 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) { }