Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp540047lqi; Thu, 7 Mar 2024 05:04:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1MzSm8duPr+kHmiee7LWRcR62SllGX0D9mrdfmwMbAM0OoqYdnzvg3KjwwdDeoG6oxb396F8oyoM5OAeKwgpKgxp+1J5lnfQblNgNBQ== X-Google-Smtp-Source: AGHT+IENo/E9YdLUL/em8Hb/FE0WCCjX91VrZkJFIFxHxp2GOdJNpXp3VDKEfAuK1qL2JZNK9uGc X-Received: by 2002:a05:6122:da7:b0:4ca:615e:1b61 with SMTP id bc39-20020a0561220da700b004ca615e1b61mr8357669vkb.10.1709816694143; Thu, 07 Mar 2024 05:04:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709816694; cv=pass; d=google.com; s=arc-20160816; b=MOHCxew75JSMU080j/78xL8czAIoPhZ6vay+ZEvopEl67X2cvFag5QR4rNHMmVwMda 28jss0GBCWM8iCGXHrd784y3RsTGaBrmKZfMSnWfxADGdj+rZ+xdBXanN0ackofHJ/PE TxYIZE0o84yABSysla4mCQl6F5+bZz3LKFLY2jCopcoEiZCTvg5Fw0M7HAGggZRemTh3 FZmeV7X+GdeebhrRrBEyGwkbbpdyqC9FdPCeXING0j6ydQghie9I5Y8/3QRBtero22Ec JrZ6++Zsfrk/kXcGQYC1AqJtIGp/HRdmgNYPpP5GNWKZywzFfhdUEJA1aL9gxwlytcwD 9u0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6YWQIkhhVvHC5hwoZW1rAYBL6I+wYdE5vFBr3lTL5Bg=; fh=9kLGKXp4CEmdHHMMSOsogNcYaRqadUaejUfFjZGRWeM=; b=KeITmxNa/lNHDLFXoiSSy2PxswRqV1IW5H+3ORr81pTe2PYFgK8Ymya75Vn7r3eA0z 4ARNZCsO/hZsXuAc84O2dBxHLHyrxulc0zS8SdRobepcUDixD8XOLGOQ8bsmDkRNXgug VL8VX5ehc0ier1l8f3aYYdzY56cggk61zESf68YWhGtgGF/bfHWSLLofxQNjIHnb7Zf1 1TNheefma346ArkrKd/do7EAqCi0hnhiqhZnU5hMjYKM/Sl+ThswHFnFINY+TlKqiTkc 2yll5b+2t11sKBJlxIZBUSiUMxHSTLdqGItqrnnSLF8yHQtJhktrLI8rQjH1Kw+cd2oV PKoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ql8Xfspm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-95567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k5-20020a056102116500b00472556fe377si2270466vsg.477.2024.03.07.05.04.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:04:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ql8Xfspm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-95567-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7F9471C215AB for ; Thu, 7 Mar 2024 13:04:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C70F12C52D; Thu, 7 Mar 2024 13:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ql8Xfspm" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D56212BE96 for ; Thu, 7 Mar 2024 13:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709816678; cv=none; b=jE0U3wUb1uhNuyK63o0BfbcgQuFHa9EpVUv4/i4jfvRK2MqUQ/QttcAH9eKOCdPJyhYi6FyOFmGflFVpnSNv1eyoUs4BYtzz62momy8oudU4KMSlJFaK5CDbSEeVN1bOmih9zwNYCxeX2yMAp8pHSp1LG0RoJzQzwmiMXApa0SU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709816678; c=relaxed/simple; bh=ydcV8KjuRh1M2V0fUWpxwuVFVEPey+xI15J/nZoDhU4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e13NuUrtJGzVVhPqgiMTC+Or7Plma5EOgAleTzPhRMKKcKnphGYwcGk0SAJKoIa7+jnns0XfOwEhpDDw1J6tG9XdaruNWCF9mmHJBnQeZKUaFeMnUrRQMfjTVYnsKLAQYFG3sCudGvLgJ2uWRGyW6/bardnG6G9HdYexVitjBRU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Ql8Xfspm; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709816677; x=1741352677; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ydcV8KjuRh1M2V0fUWpxwuVFVEPey+xI15J/nZoDhU4=; b=Ql8XfspmRPHxBCYDITQZpQ5U9c+vclPgnmX7vLRyAig6tPyhfD8amuaU ZIH8TZPR88r6I1OlW0+sUOk0E+AnBrOCFEfO6fhp8KLM6VpqxiAp7X+pC uft3odEealzp4JOixSg8d7sqlnUpEG4hYPFsjGrBLcSEBhCqYWjM6aFWd M8Exz/nosJkSI74eky6Pd66akP4PdsMpJZXR+7AhadzxfVLzICEP8GJba K6JfHG36C7vQ7PwBh2aZpcrY8EzbgNgKSJnxMi1dd0OxImoPbTnompOea NZXtknmq6lGdCQP4KIAMZnGZ2AM74y3TgTLg8ENovB8ZZRGbe3/LZHVGT A==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="5068060" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="5068060" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 05:04:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="14592316" Received: from unknown (HELO localhost) ([10.237.72.159]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 05:04:35 -0800 From: Aapo Vienamo To: Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Aapo Vienamo , Mika Westerberg Subject: [PATCH 1/2] mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add() Date: Thu, 7 Mar 2024 15:04:17 +0200 Message-ID: <20240307130418.3131898-2-aapo.vienamo@linux.intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240307130418.3131898-1-aapo.vienamo@linux.intel.com> References: <20240307130418.3131898-1-aapo.vienamo@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Jump to the error reporting code in mtd_otp_nvmem_add() if the mtd_otp_size() call fails. Without this fix, the error is not logged. Signed-off-by: Aapo Vienamo Reviewed-by: Mika Westerberg Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support") --- drivers/mtd/mtdcore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 5887feb347a4..c365c97e7232 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -956,8 +956,10 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd) if (mtd->_get_user_prot_info && mtd->_read_user_prot_reg) { size = mtd_otp_size(mtd, true); - if (size < 0) - return size; + if (size < 0) { + err = size; + goto err; + } if (size > 0) { nvmem = mtd_otp_nvmem_register(mtd, "user-otp", size, -- 2.41.0