From patchwork Wed May 12 14:44:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435591 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4998288jao; Wed, 12 May 2021 09:43:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymATS2Btiefo4XPSqtRV6gewwExJe/6Xrb6g21wFvioGGYrYdilgy9eNE0DUKVTI+5Bf2K X-Received: by 2002:a02:a918:: with SMTP id n24mr33266180jam.125.1620837792352; Wed, 12 May 2021 09:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837792; cv=none; d=google.com; s=arc-20160816; b=H9HXmechMNergDDOJA72i5/EDB77uWFWDKtOuq4gF+P7UlsroOamfaoedAVIvPk8MW U+i5BNPl6PxND8ndAuGvbts4kBKpG65t9rPepGk6p/R9YxTkOboaT0JuMfH7NC8q/msN qKvMxRHvdsp1SFEZcGoskUOUywfpXApgFxfYW5RpvEd3XPZ05YOEpT6/fYGa+mz0Daph iXW8btSwzbjvpTA0LbTbZOiEcM1dL2EJxFiseUWYorSRJrVqTeU61chXCUgCrAqQ4bSl EQKXRUf4g+v+C1XQ8XuBBzjyPRoWU9NYb9b4RodXozM3GFIdYgMuWtT+6+0/9Y4RTRoj sMaw== 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=I26Ui1RuV5PzfW3jISpH94FpU1uawYiYBYW8WoawqHA=; b=GOXoCWcDxtkoYdagjWNOFXGFkX8y4yMKF9P9VktXtZ8vIj494uHcE1trrJ1mjLTnT9 stc0OEPfIBM6N16chche6nAO9jqEhQAX4Iz1qefOt4Gh3B+HcHzEtTbITN/OWBt2Ybt4 zWVUksA75k8p+HkXvkoI9W8/F8hIOXrSHDKIJ1cpnMNdHbYxxDeyCy4q9BmTLyv4LYtw c+2BEncLm1895MjWKN2N04cjoad19Tzadv/uOg6A6XELf2nw39ho7QlLPnBEXRND1Qhu bZbprhjJlQN7FaocVn1q776EHZ47MH0j7xrex1Lp0xPvkJ3VmU3ckTV/IRjH6cs2Tpfc HuIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s8JZUnX+; 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 q8si330223ior.12.2021.05.12.09.43.12; Wed, 12 May 2021 09:43:12 -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=s8JZUnX+; 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 S237045AbhELQDU (ORCPT + 12 others); Wed, 12 May 2021 12:03:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238324AbhELP5o (ORCPT ); Wed, 12 May 2021 11:57:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E30D161CB9; Wed, 12 May 2021 15:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833488; bh=0lghaCV86HN9P4k9Br3IW/7ZQfjxzUfabvexyQPYhmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s8JZUnX+WiNWpXxo1GRBmBrfVmayDHkpTcOQ1Ntl7vsA72ite/YVhvh9kqFhkCcgf 960WWumh0lgOA6h81hdqNXuN5JFuxepitumEI2gzvNCsd+HaObn/kn3Lcrhq6GtdJF AVP6vDumcflsO1MmANYCxgN8ZNSwECrjue6lXh+o= 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 5.11 169/601] mtd: rawnand: qcom: Return actual error code instead of -ENODEV Date: Wed, 12 May 2021 16:44:06 +0200 Message-Id: <20210512144833.404009879@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144827.811958675@linuxfoundation.org> References: <20210512144827.811958675@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 667e4bfe369f..0d2d4ec476fc 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -2896,7 +2896,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); @@ -2914,10 +2914,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 */