Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp98782rdb; Mon, 14 Aug 2023 10:35:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERhp/3KJ3t/19rCjfIisgPg4G4BqQNh20zRvKlxytLbHpUoC+/ErMsXP8vipx7VA5thv7m X-Received: by 2002:a17:902:e741:b0:1bb:8e13:deba with SMTP id p1-20020a170902e74100b001bb8e13debamr12722462plf.11.1692034523997; Mon, 14 Aug 2023 10:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692034523; cv=none; d=google.com; s=arc-20160816; b=K8BDwMU/z6pUSclGVQF3XE1y5vtAJTceurGwGwdlNPGK8IPFJWHQAVxAcPUxIGv9Nm 62UizuhpsAoeFus56pRmvSsCHEurxLgxG62IE0SAjpuAVkbKesScXHNPsgzpZrfCnEGT /pT8jCqyyaI6IszwyD0CaRX2KwVIC3H2yeHSsaJmgH/dNQX1w3dTaLKKpdyE5dHAgcy0 wcSKjn+eILd/JI/aVw4d0drz2dJhdHY8udqyyWgzlUreYoS7pdfcE7NuY8G5UeV3A0QD y3dhga6q8cB6owvGcOcpqlNdnpqonkfeZbO5qJas+5q95qw23cIRlzGArzCDrXrlXR3Y zQkA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n4VOdQ2+Ao+ekB1JFBvNQB0H78lSGJ9EZdf+PWj6TOY=; fh=/5LWauCYV6P0hv3iAW0ScoxrI6wz+BRxACCCC7r6V8E=; b=dxEe38FutmqdByLrkEuYWeKu589dRrk4s5pTSddDo9wlbSh7yTAmfGnJAmdS9w+Zbr bqs1zUiLkowEO32T7065tTiULJuetOycLeDAQYWM3lqXG+5UO2BctygES69BtxPMNvLE m5/lAdl3proyrY8WjWqg6aJVAJt/ymJwATOXzlR3kw8I91vCcar+4XoMDckdOSxGRnAQ oi1/UNcFApjaP+JzeKyBAojtaa/fYBVKk/Rvpzk4qIzGZgoV569a03r6db3Jc9dA3JIx qE6kL8qvTa36h9saYqpljF0Vr5+LiuchqvlLs31CWPNx4ySulKZ85QAHpTMPW7c2OUkt csXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ezh3viEP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902e19100b001bbad1883d5si8021652pla.293.2023.08.14.10.35.10; Mon, 14 Aug 2023 10:35:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ezh3viEP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232989AbjHNQyj (ORCPT + 99 others); Mon, 14 Aug 2023 12:54:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232721AbjHNQyL (ORCPT ); Mon, 14 Aug 2023 12:54:11 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF38610F2 for ; Mon, 14 Aug 2023 09:53:58 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4fe8c3b5ca0so7303627e87.1 for ; Mon, 14 Aug 2023 09:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692032037; x=1692636837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n4VOdQ2+Ao+ekB1JFBvNQB0H78lSGJ9EZdf+PWj6TOY=; b=ezh3viEPMRHRHs9dvh9/izH9sVU1xX3spWYGYEuexLl5mImtEpNxpluipzIrkNqYvP E2RvyFDSBg0yz2jlK81CHc/ssVVqqceN7n1hUskagw4Poj5sVXHMHNIwYPPwEnTD/OYr /IqdpiR1DR1W2rH//3TNnP5CDlpR907ATzLjHGpWXY2eUhL5yjAd6EgckWFXrOGSK67r gw1HbjfLUliH9GbUVApx+dN5+kIlO0lveCj/go40CSMgwuYEGkP2RqtSHCWv/H5Ol6fP mpeCevluXsgJAPhL2LJ5SKe7Y9xB8rkq4ankdXJWn0memftbI5wBLnpIkBeNAGISxI7Q A5Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692032037; x=1692636837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n4VOdQ2+Ao+ekB1JFBvNQB0H78lSGJ9EZdf+PWj6TOY=; b=JSfFeOFb00ARN1PAly9514zNc3BO4PWJHMe880awIEGJAtlIEubwKeqFqgoB5uHHlE Whrt608r02TPTFs1YmKyDewKQeEX0Idcq2x9sX9QRZ/qTvClFXQ3Bo4IgSapVU+QHbHG tkVpZnoE1K8j5lhTm7U/8LiEJdy0pzo4NxIhFKFprdAG+8hnZPi2xd1uAEPIdW0W2PdF /L2widsJ7OmiEh/aqs1sVdVMcxKkKLNJyNNmzPhQynSvhPwsImdXJqPz+DvBKsfXuYzm FxBKSjRyjuSGcIcptsa9IQittLTMVh1Glck0JWmDGhf05v8z6rbL3v145DdazZKXv+gL rlPQ== X-Gm-Message-State: AOJu0YzyWBSTM4hzvAEVcHMKiQi7DYqAftn6Gib9h07kOtrCVDhWvHYt JWsvPGZodPGAgo0ss3XUZLmZVQ== X-Received: by 2002:a05:6512:4002:b0:4fd:da65:d10 with SMTP id br2-20020a056512400200b004fdda650d10mr8601126lfb.36.1692032037190; Mon, 14 Aug 2023 09:53:57 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id n5-20020aa7c785000000b0052338f5b2a4sm5811267eds.86.2023.08.14.09.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 09:53:56 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Miquel Raynal , kernel test robot , Dan Carpenter , Michael Walle , Srinivas Kandagatla Subject: [PATCH 20/22] nvmem: core: Return NULL when no nvmem layout is found Date: Mon, 14 Aug 2023 17:52:50 +0100 Message-Id: <20230814165252.93422-21-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230814165252.93422-1-srinivas.kandagatla@linaro.org> References: <20230814165252.93422-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miquel Raynal Currently, of_nvmem_layout_get_container() returns NULL on error, or an error pointer if either CONFIG_NVMEM or CONFIG_OF is turned off. We should likely avoid this kind of mix for two reasons: to clarify the intend and anyway fix the !CONFIG_OF which will likely always if we use this helper somewhere else. Let's just return NULL when no layout is found, we don't need an error value here. Link: https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/ Fixes: 266570f496b9 ("nvmem: core: introduce NVMEM layouts") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202308030002.DnSFOrMB-lkp@intel.com/ Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle Signed-off-by: Srinivas Kandagatla --- include/linux/nvmem-consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index fa030d93b768..27373024856d 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -256,7 +256,7 @@ static inline struct nvmem_device *of_nvmem_device_get(struct device_node *np, static inline struct device_node * of_nvmem_layout_get_container(struct nvmem_device *nvmem) { - return ERR_PTR(-EOPNOTSUPP); + return NULL; } #endif /* CONFIG_NVMEM && CONFIG_OF */ -- 2.25.1