From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60794C4338F for ; Fri, 6 Aug 2021 19:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21F2960EEA for ; Fri, 6 Aug 2021 19:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243972AbhHFTqL (ORCPT ); Fri, 6 Aug 2021 15:46:11 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:34835 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbhHFTqJ (ORCPT ); Fri, 6 Aug 2021 15:46:09 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id E5C281BF203; Fri, 6 Aug 2021 19:45:50 +0000 (UTC) From: Miquel Raynal To: Manivannan Sadhasivam , miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, boris.brezillon@collabora.com, tudor.ambarus@microchip.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dan.carpenter@oracle.com, martin@kaiser.cx Subject: Re: [PATCH] mtd: rawnand: Fix probe failure due to of_get_nand_secure_regions() Date: Fri, 6 Aug 2021 21:45:50 +0200 Message-Id: <20210806194550.392325-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210727062813.32619-1-manivannan.sadhasivam@linaro.org> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'b48027083a78b13356695555a05b0e085e378687' Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-07-27 at 06:28:13 UTC, Manivannan Sadhasivam wrote: > Due to 14f97f0b8e2b, the rawnand platforms without "secure-regions" > property defined in DT fails to probe. The issue is, > of_get_nand_secure_regions() errors out if > of_property_count_elems_of_size() returns a negative error code. > > If the "secure-regions" property is not present in DT, then also we'll > get -EINVAL from of_property_count_elems_of_size() but it should not > be treated as an error for platforms not declaring "secure-regions" > in DT. > > So fix this behaviour by checking for the existence of that property in > DT and return 0 if it is not present. > > Fixes: 14f97f0b8e2b ("mtd: rawnand: Add a check in of_get_nand_secure_regions()") > Reported-by: Martin Kaiser > Signed-off-by: Manivannan Sadhasivam > Reviewed-by: Martin Kaiser > Tested-by: Martin Kaiser Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks. Miquel