From patchwork Wed May 12 14:44:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435570 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4944947jao; Wed, 12 May 2021 08:41:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVJNAhk3DiKuMD2hO2YXYyjU2x0zkQRcNTKMOd+1jjyzQi8Yj/N9cDGCmqBkEmePEUgEfM X-Received: by 2002:a2e:9f44:: with SMTP id v4mr4389987ljk.475.1620834110298; Wed, 12 May 2021 08:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834110; cv=none; d=google.com; s=arc-20160816; b=OQX5Nc6afhDof/9g9sLuqdcZdPiZmtf8yq/0TsMYknrz2y+iJSa3zudJr+v+PZrsfQ AdwaE1y9iMDuPoHXfkJ8yoiw15VEPjJZNHaydNSJQLifJyamOmyqgW811pc/htloowYJ 4gHaQR4ctHFm81AuCVouHr6DHq69xjjBnm1gi3u/FdmMSJ/HP4gRKCRZrsqVXi8CP0e1 JyjTL3t+5ROTWL6rk8OtH6Svo23QJYN5MGTeMX0kFNik7sY2Dd/RjZjWx25BPoykeyjy YqOihsHOLJ/vFz+aE/f7h8f+L1jlaCLuKSkj+DHoM2DU88BCdiCTXg7th/FjEaQG5OVB a5qw== 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=NaAPEJAD7WUfyNSmM9argWyx9sj3BISYmZ0E/Xeo8y2SfCn1i40w72zRWhBY9Q48J0 84oTMlrYVGWjeoOqJQxGQDAcSHX0x81+2x9n2CisTn9yeyvEiVWRyCk7MaqWCWnGxbM/ A4Wk0TKQqeDWf2d5vCqSqnqUlBDHla5gpkxEZiQ/FwD4aRJlNPKE3sTHvadgEdG9Ak0u Pal0382wzzfIRYhp14d6a9cRjG3bcKgKwQhIumCqnMSB1H8XT5Y0+XRxydGZGq3PJmU6 Av++2JTNyVaA28LLWwDhGHAiNiEsxdY2Zih+uGRjleA1/yyayX/VxPF2w92ACct1VB2C cMxw== 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 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 m20si100438lji.284.2021.05.12.08.41.50; Wed, 12 May 2021 08:41:50 -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=WMM4g5wo; 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 S234553AbhELPdL (ORCPT + 12 others); Wed, 12 May 2021 11:33:11 -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 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 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 */