Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4615899pxj; Wed, 12 May 2021 09:18:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwBsH4ujBJPJjZXFX0fWRGNDwoXkvrEbghwvfwKvtFQ2rVhR9JBqQNpWdZZQB+Op4uGlnh X-Received: by 2002:a17:906:8147:: with SMTP id z7mr37841137ejw.496.1620836294365; Wed, 12 May 2021 09:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836294; cv=none; d=google.com; s=arc-20160816; b=NKYrXHEL94P8fMKYGIPKkMurWS7pKfsNDTSYAf/x2pZXYQXLaGjTHZEkLfYALbT9iq ZAlCS1MFVW9MwLE6VsV8rZ+SPSIXRTUtDrk92MUf3OJ1P3650J3zsHn/wYCKNnyhT+7L j1MdnD0Thy24GNFXN6a6Q5CvkrUK+3DjC4Awpe3xW/XkST0TE0U+v8S6PmfN+vQuDP1s EiQHeSHBNx4QD73RYW9/7gQsYfzpv+aOF75BVIz1ewAPTIh/Yfg1XXcaznJZAeco+vT7 10yIKh/W0k7qAWNKzskC+gIuAnV0xHYUTQi3UCipX6k7URsT6QiwYtKTiokRjNE+rssd b7Tg== 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=YqApvVVfvdU8owoPwfaBE56Gd0Yv9zrR/Gw5e27zxvM=; b=TT5Ze/WQGHFAOLsqfKGJuaAZg+hCLcu6d+Ktx9UFkF116BLQBsvfZJekrEo5fGMJ1b VnqDcqN/LLMKjyupu4FBlyiFnVwu/e1FWQ6ypZh5wDwOellat3qF77VibBG5zfcU7z7z FW7h0cjqy6iqj2K1gANUH+0XkpNSD1rpiv/dTI3Ra2PDJAdbV+vmRgEXfQtzqu1Tzfok kouUEd8FxGEQzwyHv9aESzkClry8HVTuGqEhrmmv9pezyktXS5KLK6K0m5kH+6EIYZO7 NVRRWHarleSR5d7k31gUu+TZ9gIBP+mFNSmRPeOrp29BSM4DmZkyWO9Fr+U5PgW1NPSl VIOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WMM4g5wo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 dn11si453218ejc.126.2021.05.12.09.17.49; Wed, 12 May 2021 09:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=WMM4g5wo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S238785AbhELQGS (ORCPT + 99 others); Wed, 12 May 2021 12:06:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234282AbhELPYg (ORCPT ); Wed, 12 May 2021 11:24:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1BDA3619A2; Wed, 12 May 2021 15:10:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832207; bh=eeRkkqmWN/6cfDCv5KC62VnRs+/cdDaUUcTJIArgbq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WMM4g5woPegtSfckESb+r8mg+Sa6Y0x3dYdJdOMdpCUwHPmzUFYsyxcKQ3WTLgxcy XyQxReIcLw8xaUPCQeQ8MQP6MFe3OvC4WmksshOi7h3OLGAYKtQ/7kqEY70SQF04qT g13oYo4+DecFhABZBBVXsUtkk5fwx4sFjoMIjbIQ= 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.10 151/530] mtd: rawnand: qcom: Return actual error code instead of -ENODEV Date: Wed, 12 May 2021 16:44:21 +0200 Message-Id: <20210512144824.809522231@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c index dfc17a28a06b..b99d2e9d1e2c 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -2874,7 +2874,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); @@ -2892,10 +2892,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 */ -- 2.30.2