From patchwork Wed May 12 14:43:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435632 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp5102091jao; Wed, 12 May 2021 12:04:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuNAKAmLmJUhACXhPUUEL1NfA+pUahQjBIFVHb+SMUxRYA6A8Yu5LGm97kbXl5eDbcvDJ9 X-Received: by 2002:a92:2a12:: with SMTP id r18mr31737219ile.170.1620846239873; Wed, 12 May 2021 12:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620846239; cv=none; d=google.com; s=arc-20160816; b=YPEi6M1frZ8YBH6lQCwsMOK2x8rCGfXjQWzeDhBBIe6A4iVFISyT1RiqozyoP+2x2s LmRUwAUv8MWQDZ4q/fOEixsmIaFmBp7hQpA1Fv1bS91YJxAxq3iFUvEvRXtwYH7jqtY+ +mfVpgwYVLXIcjz9yZsozT3mcGs4gKnDYUzhkhiTqhyCj+zhbCfpy78U6C8sL6HfK1wv l6WyNYbjc7OezX0+WQpFOPc9YoUAH9vQ5BZj8Jfuidw2IFCb71On+Vyqovm07HPMg/Bi 1zvSJ7p/j+UXsvIxbvKpvZ9roXd8isXBxMAweEkZwqTKwXCMgv96WG8S4ROBuomrDobw +Qcw== 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=01x6H0NC8tzrvs45hPrvKe3y4D9zXsoA04xQhYBr6EY=; b=R3rsp562GwvuOSm1BE4YRPudwFpQgqRwkhVusd4fxzeK/Zlbzzv9s4xVMNf7GNINzn pm/emwlaIEPvMc4/jjKqQFid6eYemYjsDkPxv4bbPUGPpWuAUPKsVedsgkWRArJZNGfG 5JcymF/Lra+ujkbZQ3/cyj7csBttrmezHOMPhTuFrERkzyeOhEzkzrZ6C1xASVjdz5B8 NhcW2qarSV4L+5ndvEKpx02Enw7huf2o7uWxL9MfXduatwbOODJPw67Ci2pzvXgETfGi 2hVzcHJuegALG2dY9uJ15C4am9S4Debzr1IoMEdqaymdS58AWkDDm2Kl6y1TXdSEfRQG WDTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O1bl3hD+; 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.12.03.59; Wed, 12 May 2021 12:03:59 -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=O1bl3hD+; 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 S237755AbhELQi6 (ORCPT + 12 others); Wed, 12 May 2021 12:38:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240118AbhELQa3 (ORCPT ); Wed, 12 May 2021 12:30:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5395861949; Wed, 12 May 2021 15:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620835039; bh=SETxy7Scf9Z4x/lbZ86/At02oUumXSPlb/yXPx43M3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O1bl3hD+Yl5B1NZrnR5zMH+Zhdw8NHrUBUuqQ9Y3wV5u6S40HSIuJFC5jdfEMC9mn ZGMsbllLzYm/WqbBbJG4zLkMqa5+07FOgL1vHOJGWIFLAEHUZeBNLSCAoRic9lNCeY y+Oi4VkX1B5Hb+n0nRFokUIvKS702D4OV6SJrZ5g= 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.12 183/677] mtd: rawnand: qcom: Return actual error code instead of -ENODEV Date: Wed, 12 May 2021 16:43:49 +0200 Message-Id: <20210512144843.329143443@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@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 fd4c318b520f..87c23bb320bf 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -2898,7 +2898,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); @@ -2916,10 +2916,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 */