From patchwork Thu May 20 09:19:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 443187 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp2127999jac; Thu, 20 May 2021 02:51:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYSPkU5s/sw0Ys+d4m+2xwYRkeR/djZeoC/HSNQPhoD4YCa8Ddnbvbhg7QpNov/UwVCNC7 X-Received: by 2002:a05:6e02:1649:: with SMTP id v9mr4384245ilu.62.1621504315847; Thu, 20 May 2021 02:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621504315; cv=none; d=google.com; s=arc-20160816; b=cLNzsUW8weDi+jftK/dEnKwx43hFsVlsrBsZKiZT9DBnX2YDXbBGrLJFwPVJ4gIB8J 4+4877EaqrSZKfx27R+PeP7RN6XOib9hNGKRKWj0/h+tn76s4jGVYc7U8M14OmdO0AgY sx/nUqDbGOsCgok0cMoNuxcz3KcuGjRYp8+FgiIwsKEe/idpsFx8m8vIpRU+4iuipQqO KJgsmEyfoHzdJDCHAfhrEby4x2PZoMkt8jWbVVKddVaQySlevXbL1j26qSABtFrqhT/O sobqCm6Y8KhYRdHv5+ueRjO9+gaqic/y2woyi8QwHHWljrGe4Zi31SqAaeYE3pTPnqPx JjWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QegxwHvebFdEMJ7j2AVWeF4amAM0RmsUqDfUGXNE0Ss=; b=WNJP5v6WiueMWwIGdFUh2RkV+jll8Th6IBVMd8rR3+5eYZF50RS6K8PGMUsRNzxgh+ tfaIsztPZgscpFhRyeenZijuJB9f16tywlB/ebyS9YmeemvnsFFpTbWM2K/FBIbpfgmz aBJBUZn99eXJFpSizp7R4KiGBenkIHfBJEDuAbTkPRclb8TAtkQBHdamUhTdcwbBxoSX +t/GsoNscFBQGli4Dhl8UidvDmKosoUDTzHhPWUci3kwZJAiMjWLQjQIIjAQgE5GuyDZ wzay4muAu1w70Z/3L8WXdtAxe8ZnsBFofENVZYtnmk7V7qby11kqBR7DNwsRZCX+zoGE O9XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A4Zpa8Ph; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c7si1876571jap.0.2021.05.20.02.51.55; Thu, 20 May 2021 02:51:55 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A4Zpa8Ph; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233669AbhETJxE (ORCPT + 12 others); Thu, 20 May 2021 05:53:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:52778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234022AbhETJvD (ORCPT ); Thu, 20 May 2021 05:51:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FA1761483; Thu, 20 May 2021 09:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503340; bh=W79B+XYCSlgHYM4bkTfgQTXiocI3S3lj9Bj8VehCPBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A4Zpa8Phrzu+i4lSoQL29E/4AjKkWwE3Op2V4HqjNBpkHvueN/Nuog7Mk1Fi1MdfO +i0JvFxlXinut2ffllaAtvzKonNHOjPgIx3NlrNHyUyrS4epMNC5gIwtDr2nKsexvd 8Ir13OsdOFrK7jHB/JrvOX8BceIeBVxH1oXI3fG4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manivannan Sadhasivam , Miquel Raynal , Sasha Levin Subject: [PATCH 4.19 176/425] mtd: rawnand: qcom: Return actual error code instead of -ENODEV Date: Thu, 20 May 2021 11:19:05 +0200 Message-Id: <20210520092137.220941795@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Manivannan Sadhasivam [ Upstream commit 55fbb9ba4f06cb6aff32daca1e1910173c13ec51 ] In qcom_probe_nand_devices() function, the error code returned by qcom_nand_host_init_and_register() is converted to -ENODEV in the case of failure. This poses issue if -EPROBE_DEFER is returned when the dependency is not available for a component like parser. So let's restructure the error handling logic a bit and return the actual error code in case of qcom_nand_host_init_and_register() failure. Fixes: c76b78d8ec05 ("mtd: nand: Qualcomm NAND controller driver") Signed-off-by: Manivannan Sadhasivam Signed-off-by: Miquel Raynal Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/qcom_nandc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.30.2 diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c index 2726f1824233..148c7a16f318 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -2865,7 +2865,7 @@ static int qcom_probe_nand_devices(struct qcom_nand_controller *nandc) struct device *dev = nandc->dev; struct device_node *dn = dev->of_node, *child; struct qcom_nand_host *host; - int ret; + int ret = -ENODEV; for_each_available_child_of_node(dn, child) { host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL); @@ -2883,10 +2883,7 @@ static int qcom_probe_nand_devices(struct qcom_nand_controller *nandc) list_add_tail(&host->node, &nandc->host_list); } - if (list_empty(&nandc->host_list)) - return -ENODEV; - - return 0; + return ret; } /* parse custom DT properties here */