From patchwork Tue Mar 2 13:27:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 392121 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp5248122jap; Wed, 3 Mar 2021 08:14:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6A9FLT83PDDUSJVdwyjgff1IqDaMuiWHOaRh4DrnAKuTlYp4Q6oyP9pG6y7O8Q7iGMPR9 X-Received: by 2002:a1c:bdc2:: with SMTP id n185mr9835028wmf.128.1614788054470; Wed, 03 Mar 2021 08:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614788054; cv=none; d=google.com; s=arc-20160816; b=NmzEV95f2Y9uAe6HxtgAA1N/QRSTYQm3S7JJ+2JD1qVUKeMTtXBJ1chghtXwfOmYmA sHY3x3CTj8aWPJ4IWIx7kBpT7oASDDqD8ymG8dpmIXfGAkREM91DJemBwd0K1BX67h8b L7ojyd0QBHijbq4qjM3tNu2oqxsHa8wW4iBdItiY8HfrBVvl8QvXaFwitrEKIAl8eWX0 Xr3ah3X/iZwcMVx+WyEEdfhUboWPbkL2b5GqttA7faXe2uPpoRY8jR5ckL4kfm8cnyHY 3T2z8yYMym275PKc5uvFWXZ58moqfKbG+pyrQGCMps/a42CO35G8Rq31yIigMdFPni2t wJiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature; bh=/rKNpbrLoD1Cw0iCafyxQQbXMvQ0QW3zKWcsOq2srhA=; b=dwqV0KRzba9CbBODZCsdtQdwcgpgYQqT4juNUhBURCmOVf/5k+cHU4og5U/1E8cVlW argB/tBSik0WSlQDnqh5zCe5E35Dj91KNpXJAJHNNUk79X1TZuQWbxr9hHqfeYlEckmM fQpy9/WP6qx/WqjgluEqeC/b4wJ/z7o96uOlLetkPIm5VS9WjP24rRYS7kZUq9bLc1CH m1qpBoDgmiwlAc+Ox/M2vEjOlSXwBY88cKz0qdaVm0YmgcOZWw7QP8iha7/iEeSydhz8 UpXxGzOj4EXvWEzJr6B9x4hBYz0zq/hlriKaU2XQNvelBW0Aayjd/hM6C40+lVLYPSbH 3maQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=TyJAMoxd; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=casper.20170209 header.b=qvXBziu9; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=yACFu5QX; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id d15si5984141wmb.48.2021.03.03.08.14.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 08:14:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=TyJAMoxd; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=casper.20170209 header.b=qvXBziu9; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=yACFu5QX; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/rKNpbrLoD1Cw0iCafyxQQbXMvQ0QW3zKWcsOq2srhA=; b=TyJAMoxdjI9FMoLjAEUoB3ZPj j1aQyLkpy00fLqrub2VWzhQ1iNgiw5m4LmQiYPteYpsc2cs1ErE+dVkvikkACfV6+znLCHp8HkKE6 FnqWuwg9884JZWnHmf6wmGm2i+h4ntsMfLRi5oybtNkS/OmUnCXhXn4OuKackl/HDIEMyvkX2+VTV w/HdH0i+9CfbHKcxhicK7X+OE2ucbXPEI/2K+nUSjXlv1ZRhSDfZyDDY3d3ShGjPCxbBRalW+jyrL dZJBgohkV7N/xTRHSGf+Yi6rwG6YCMMIW32+/dIS3VKYMKZ7L5MIv6u20ntLPdqiAuPc2Vs+wUeT+ olg0WgG0Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHU8Q-005YZE-Nu; Wed, 03 Mar 2021 16:14:02 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHSp7-005Doo-B5 for linux-mtd@desiato.infradead.org; Wed, 03 Mar 2021 14:50:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=m7oz8g4qBib/YKo3cyWxkyrFd1RmlxMZFfZ1/Uas0RU=; b=qvXBziu9mziQaMRqMamqGzxuIC jZElaNZ7HvYqfr9ZYlhhODcPBEmlwa6jt/fjX0NjiThITxV8h1iqHdHfQcogchCffTVYsWIpaApzk WQkSmhyZE70mevCeZQypCO7uGCaaJmlVLNxUNtGWJbaUK7ulEMPZChaUiDQEreQwez8oQPfFLEIv0 UzHvhFqLJiBo1/KU19IZ7UgnBhB2vEkBBhEu09JIuJsmv4vRjr5YT6XaR2+oR8kJIOwpg6cja8TUM G4fvcAAQlXx8yLgKa9e+lz+Ej5Ag0r7anUK94eGE48Jk+k+hbLbeSOvRHNP5e/i1cw45VwVy11zMM bb7E8Zgg==; Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lH55X-00HBJH-7s for linux-mtd@lists.infradead.org; Tue, 02 Mar 2021 13:29:25 +0000 Received: by mail-pl1-x630.google.com with SMTP id c16so2561994ply.0 for ; Tue, 02 Mar 2021 05:29:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m7oz8g4qBib/YKo3cyWxkyrFd1RmlxMZFfZ1/Uas0RU=; b=yACFu5QX1bnGgYUH4FBE0uTtamgfft1DFQ7l1w0A4JJ5ZhVafDNQDrhomC7sqsSj5z 78TbMpBE0sRpryLTnlzIrpvCQL108o8rYSbzd/zIWut1l+Krqq/RrAcRNQXNHYnjrE/U MV/zx9mafCzEnTr1i7V/vHFywoRVk68kT+pZoruldys620xohe+eHVI4HVUsx1NItCKW fUU5TP684i75vAao3HY2VoG+ebEcmQWIjftRiOMSrMgf3XpTk3/43Z9ss4z6mD40kydk 9Uva377Dgkz0nh9JURq8fP5xo19ETK3TFXFxReul0wyTdRd8xNl2n/LhNDweZG2z8AHj 5bwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m7oz8g4qBib/YKo3cyWxkyrFd1RmlxMZFfZ1/Uas0RU=; b=B0mx8jwwY9thmoGS1W71aWuFfl1mbghT4o1eLAsKAM753V3n26lMrCtskIkYqrnVDc iCppamMoVJ0/dXE7gwdW7gJK63YZOh6QgG5DyeTQnMJ8/L/hW9SRHmWgWAkAcYh9vnKZ dbnhxW6T/GsB8WLjGso3EScw6ZyCJn2ezp5F/2fpUUGDP9IjstYNtjCoauova12eGdqt aTalSHG7Btqn6iM8itnBDLepYD8otSRMMJoB3f7D7haKdQffZ+3+d4PGe6uyk22TrZbS OFNiyUzFyMLIKSl1uWM7d4vHHa9sB9Jppr45ojqnSL87OOth38xvnxQahms3CvcIlw92 ldGA== X-Gm-Message-State: AOAM532zhZ3bDrUFVV0YVc2eDmopSGhuws7JU9LkrBFzKQH6tny8OO6G lEhaXWe8xJE8mk1DqpoVrUZZ X-Received: by 2002:a17:90a:a794:: with SMTP id f20mr4264897pjq.185.1614691696400; Tue, 02 Mar 2021 05:28:16 -0800 (PST) Received: from localhost.localdomain ([103.66.79.74]) by smtp.gmail.com with ESMTPSA id w1sm13027454pgs.15.2021.03.02.05.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 05:28:15 -0800 (PST) From: Manivannan Sadhasivam To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Cc: linux-arm-msm@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, boris.brezillon@collabora.com, Daniele.Palmas@telit.com, bjorn.andersson@linaro.org, Manivannan Sadhasivam Subject: [PATCH 1/2] mtd: Handle possible -EPROBE_DEFER from parse_mtd_partitions() Date: Tue, 2 Mar 2021 18:57:56 +0530 Message-Id: <20210302132757.225395-2-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302132757.225395-1-manivannan.sadhasivam@linaro.org> References: <20210302132757.225395-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210302_132925_691796_AEC9E7CD X-CRM114-Status: GOOD ( 15.85 ) X-Spam-Note: SpamAssassin invocation failed X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org There are chances that the parse_mtd_partitions() function will return -EPROBE_DEFER in mtd_device_parse_register(). This might happen when the dependency is not available for the parser. For instance, on SDX55 the MTD_QCOMSMEM_PARTS parser depends on the QCOM_SMEM driver to parse the partitions defined in the shared memory region. With the current flow, the error returned from parse_mtd_partitions() will be discarded in favor of trying to add the fallback partition. This will prevent the driver to end up in probe deferred pool and the partitions won't be parsed even after the QCOM_SMEM driver is available. Fix this issue by bailing out of mtd_device_parse_register() when -EPROBE_DEFER error is returned from parse_mtd_partitions() function and propagate the error code to the driver core for probing later. Fixes: 5ac67ce36cfe ("mtd: move code adding (registering) partitions to the parse_mtd_partitions()") Signed-off-by: Manivannan Sadhasivam --- drivers/mtd/mtdcore.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 2d6423d89a17..d97ddc65b5d4 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -820,6 +820,9 @@ int mtd_device_parse_register(struct mtd_info *mtd, const char * const *types, /* Prefer parsed partitions over driver-provided fallback */ ret = parse_mtd_partitions(mtd, types, parser_data); + if (ret == -EPROBE_DEFER) + goto out; + if (ret > 0) ret = 0; else if (nr_parts) From patchwork Tue Mar 2 13:27:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 392122 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp5251950jap; Wed, 3 Mar 2021 08:19:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxav5GCPiwgvxdiut80MAQfpO3KG/IuofnaKOrYzBC33EQv0KjMnH0La/Nr09u7bKAg+r0r X-Received: by 2002:a1c:4e12:: with SMTP id g18mr9061974wmh.56.1614788365068; Wed, 03 Mar 2021 08:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614788365; cv=none; d=google.com; s=arc-20160816; b=RqkxLSJOTkHmjrZnFN0RVUFRBRdSSRMna+6Bfq5wYo9SgxFaO02YNBXyLAlcDO7G97 UsE2Ps+/4e3Q6W/TOtdaH8Bj3c1TPYLqJ5ZOQ+OJ3Wr3MTO99nE0bpTdbK5Sp522J3p3 CByoGUFRBQK1L1+5H6T1oM5vUBb4C8CMrlV/f4NLA6HpXVqOzsEoAhAS9zWVMLsMITGY g791pECoHdXK+nZoqKyfHK8B0rgO+iRI8parK42Whss90tnqU0BflPVKPhlfF1wfoUOF 7exgdRD0FAQ+8d0ReRiA9tSTGZUDncUy8r0XDdqxTRbYow/fDZ5+hDbZfkBpwbmwLnuv g3WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature; bh=f1zMk1ORK7/aptHSIJh28U4gMuioMtGXo4KiVGTcF3I=; b=mur1x9PuRDo0Xg/TZ6Gn7Bb/guaxU9+vfSoiENIHqu5QTsec+UPxaju3gDzl4/eIWB 180wIQuDnAwo5bLxJ+atotfecJ4dKVYVsWC2D4QhcJ+uPJII9C8Gs4Cj6LQVFhd0yTYB 7zlwl9MKWpLCHzAhTUaUrvtt6qQnvgMyb9J/JdClS7hNZ4G8CStzxoSarxHTvjRDDpaS u5L2S1flDi8tKstRvl8l4q/rTZEdlzZ8c/lxEekxtIz1wtO7V8Ws71wjGNP4wlOis5/g OC2suhg4zhzb54aIqGFdcmYUnvClp+h5UlQWEsQxo9pALtY0GGACYNYBRQjvTk4FtQNJ hWHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=b6OA52Ic; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=casper.20170209 header.b="wIcOT/x4"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KhrvHfmW; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id z185si5476898wmc.12.2021.03.03.08.19.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 08:19:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=b6OA52Ic; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=casper.20170209 header.b="wIcOT/x4"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KhrvHfmW; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=f1zMk1ORK7/aptHSIJh28U4gMuioMtGXo4KiVGTcF3I=; b=b6OA52Ictdq6FhsyZ/PDWsZAR 87UKs7dch5gEp/8lN+PKqSrMSb93QsOVGtCY9U0yns+mkA8xFCUp55IUt5z2fuNLTRdxPCmSM+A72 wLzzj04bqZOoq3zzSfJvQnUP0aS8QqDG9Yj3KDgOarCjtvstuvwElzQ9jYV0EyjD+LJi2KMEqiLS/ 8sSDb3I5zfAbb/KHO2ELeFCtFHpDy7yU5zjqeHjrWjqJr2jaV6vcevREueIYJWq/2WY/Sje4aHvRa QN6OBo1bra/n3oxTqST6bYih6Y1yLsrGT5ABH5Te+Q5fP6ORdswOyPNgZ19G/gpX5E0eyEHDpSU27 3pelMuoTQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHUDM-005ZYY-Vj; Wed, 03 Mar 2021 16:19:09 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHSpZ-005Dyz-2I for linux-mtd@desiato.infradead.org; Wed, 03 Mar 2021 14:50:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=PqPgRtzVantKyRNR1zZk8EcuOOdksOMCXe9nMbpmH0o=; b=wIcOT/x4mukjfN8wOe01eDN6KW Q20MsF4cyutztFkLzOgKmcUli7ZgnJsuenroZEU+C7BNQQ+Dvy1XohXUsI97fWMHksUW+pmtuPIDS LEtpQw/GmiVCyxQ4xyKltQqXHaQ4rfeyb006Py3VzCvnbA5RuK8k7Bgi//4M3WZyrcF31/iXLi5Qg a2ApUf99nHxdA60asQGequFXDPRtTJqA1x+Ktc92afZROJjc7zNeN2GxrCj4f37JJl1L1yOzvcF1a 84RGNWf7ODeN8FVmrO/msW9YxZGyzUQWvCx3dQp7rIkKLS2wJj9xDY8A69mvMm5DBoDcvhdHAipYb EQJmwvRg==; Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lH55X-00HBJc-9e for linux-mtd@lists.infradead.org; Tue, 02 Mar 2021 13:29:25 +0000 Received: by mail-pl1-x62a.google.com with SMTP id s16so12023625plr.9 for ; Tue, 02 Mar 2021 05:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PqPgRtzVantKyRNR1zZk8EcuOOdksOMCXe9nMbpmH0o=; b=KhrvHfmW54YOdVY/n36ESd9/pdRvnND7vy94ZX7v6gkP5vQBdXGN/2dndp3CXxob3O 0xMeF80owgoInE0hQvw9eGl03YK8+P0PKUT2rXNJ3ONhuXnfOSMmTf3VtvCO/ptCPAqb DXKMCse35CkVmQeA78HmSuIAQyPaFWs2nNBIa9NbaKLdp4jgWp5zpPvrVYoBl7C5Vk6w j2pEp/wBwj6eTOtiFQEqb6jkJ/lxD2E5PA884lKxkGRlbTegtYSV4Ui6eCJOCyMFbsEp 2VYrcxUAv3oRz+zpM1sbFxRvZnaXWtaDXrr5JyKx5Jh+CDdC61bYY6SslLIX8dgWxt8H 2BhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PqPgRtzVantKyRNR1zZk8EcuOOdksOMCXe9nMbpmH0o=; b=LaiKqxJnmSMnTcouS/Nl0G8aNLZACzW9kRyBkl1539mcsLiacqhxeFI56owWfFFm+W NWM2ihr9AcRIrbprltgmmYjXrMPQcsV72e4vz3iml+VTDY/9JOQa3GCelZD/ZtB/sLLh 6QIbICr3cPKOT4JHtMdurfWoxevMR+ySoggYphEA9Y9jL9tU3RkovZYuvYH21zGG9/xS Xh+nKxA/EdWl4SyuTwItUt2ZmG4kwMUFSJy5dve++Sc2zHWETQXEDbYo210npswNwMLo OtvpwQzR8sTPKIiEyrJNKnTOAIVI/mRQyWcxOHBtJltRWrugq+TuWwOFIpMujKtbV38T FbNA== X-Gm-Message-State: AOAM531mCOR6Q9p9kl8bRvdnBWKdvnjvJzRq87Zslc6LhU1NTi4gjgVQ yrEjAahRN5OAhAFrYTCWOUhB X-Received: by 2002:a17:90a:e2ca:: with SMTP id fr10mr4533637pjb.18.1614691700590; Tue, 02 Mar 2021 05:28:20 -0800 (PST) Received: from localhost.localdomain ([103.66.79.74]) by smtp.gmail.com with ESMTPSA id w1sm13027454pgs.15.2021.03.02.05.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 05:28:20 -0800 (PST) From: Manivannan Sadhasivam To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Cc: linux-arm-msm@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, boris.brezillon@collabora.com, Daniele.Palmas@telit.com, bjorn.andersson@linaro.org, Manivannan Sadhasivam Subject: [PATCH 2/2] mtd: rawnand: qcom: Return actual error code instead of -ENODEV Date: Tue, 2 Mar 2021 18:57:57 +0530 Message-Id: <20210302132757.225395-3-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210302132757.225395-1-manivannan.sadhasivam@linaro.org> References: <20210302132757.225395-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210302_132925_692337_A2CEBD96 X-CRM114-Status: GOOD ( 13.72 ) X-Spam-Note: SpamAssassin invocation failed X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org 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 --- drivers/mtd/nand/raw/qcom_nandc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c index c2dc99c1b2f1..54230f2c1a3f 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -2952,7 +2952,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); @@ -2970,10 +2970,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 */