From patchwork Wed Jun 8 06:51:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 69581 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2339401qgf; Tue, 7 Jun 2016 23:52:07 -0700 (PDT) X-Received: by 10.66.25.133 with SMTP id c5mr4077199pag.103.1465368727700; Tue, 07 Jun 2016 23:52:07 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id o10si3238485pax.140.2016.06.07.23.52.07; Tue, 07 Jun 2016 23:52:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A6336E8E9; Wed, 8 Jun 2016 06:52:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 63BE56E8EA for ; Wed, 8 Jun 2016 06:52:03 +0000 (UTC) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8F00BQDXQN8440@mailout3.w1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 08 Jun 2016 07:51:59 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-ab-5757c08fc74b Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id AF.82.04866.F80C7575; Wed, 8 Jun 2016 07:51:59 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8F006KPXQJU360@eusync2.samsung.com>; Wed, 08 Jun 2016 07:51:59 +0100 (BST) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] of: reserved_mem: restore old behavior when no region is defined Date: Wed, 08 Jun 2016 08:51:53 +0200 Message-id: <1465368713-17866-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <20160607143425.GE1165@e106497-lin.cambridge.arm.com> References: <20160607143425.GE1165@e106497-lin.cambridge.arm.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xK7r9B8LDDc70K1psnLGe1WLhw7vM FvOPnGO1uPL1PZvFm7drmCx+vL7AZvH6haHFpsfXWC16NmxltZhxfh+TxYGl7SwWa4/cZbdY /azC4uCHJ6wWh9+0szrwe6yZt4bRY++3BSwe97uPM3lsXlLvsaX/LrtH35ZVjB6fN8kFsEdx 2aSk5mSWpRbp2yVwZcy/vZ2lYBF7xfPnX5gaGFvZuhg5OSQETCSWXfnMDGGLSVy4tx4sLiSw lFFiQ69AFyMXkN3EJHHg2nJ2kASbgKFE19suNpCEiEA3o8TJ811MIA6zwDNmiTfvPjGCVAkL BEvseribCcRmEVCVuNnxhwXE5hXwkHj8YA7UOjmJ/y9XgNVwCjhJ9G37ArXaUeLkjfesExh5 FzAyrGIUTS1NLihOSs810itOzC0uzUvXS87P3cQICduvOxiXHrM6xCjAwajEw3tCLzxciDWx rLgy9xCjBAezkgiv2D6gEG9KYmVValF+fFFpTmrxIUZpDhYlcd6Zu96HCAmkJ5akZqemFqQW wWSZODilGhhtGx47rjKp3aG5YEd2QUD9+ycCf33ljZKc9qtK/L30v8CW955rucixp98ufVhw 7Ej34ZfZppu8L9pMuXAy9NyhlTwHWybs0Has7X2RYL165v2KC7dk3pe0fav7KV7gcM3j56fn l3NYLnTI/7iet1d2p87sVVyXfwU2956OKH2yKPJ1WZ2FSTS3EktxRqKhFnNRcSIAxyGlkVcC AAA= Cc: devicetree@vger.kernel.org, Kamil Debski , Bartlomiej Zolnierkiewicz , Daniel Vetter , Mauro Carvalho Chehab , Liviu Dudau , Krzysztof Kozlowski , Javier Martinez Canillas , Sylwester Nawrocki , Robin Murphy , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Change return value back to -ENODEV when no region is defined for given device. This restores old behavior of this function, as some drivers rely on such error code. Reported-by: Liviu Dudau Fixes: 59ce4039727ef40 ("of: reserved_mem: add support for using more than one region for given device") Signed-off-by: Marek Szyprowski Acked-by: Rob Herring Reviewed-by: Sumit Semwal --- drivers/of/of_reserved_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 3cf129f..06af99f 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -334,7 +334,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, target = of_parse_phandle(np, "memory-region", idx); if (!target) - return -EINVAL; + return -ENODEV; rmem = __find_rmem(target); of_node_put(target);