From patchwork Wed Mar 8 08:20:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 66109 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp213320wrd; Wed, 8 Mar 2023 00:45:35 -0800 (PST) X-Google-Smtp-Source: AK7set9dP74XfMXXn0X4JlnEpF7bufD4ghncDa63JLBtszBf1Q1dsL4j+6DE98FnpwISFRPS9Twx X-Received: by 2002:a17:907:869f:b0:8a6:5720:9101 with SMTP id qa31-20020a170907869f00b008a657209101mr20797837ejc.4.1678265135757; Wed, 08 Mar 2023 00:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678265135; cv=none; d=google.com; s=arc-20160816; b=GvCOxjOKLYDbQUcNbTPJ0bGbUitfA/TpYFB8EGxFj0hlOJTuij2UQ474+akNqSbWj6 FrabaUHK+Hzz0F0xM+ILbvnNkn2aim4gw0A/ne0uvnhPMPkRLPLuX7un7g2Q+CVqMANH SHxD35RT8DlUr9Sci1Qm3g+/fWPu4LCaz9FvpQkQKyrA68P71ZA0aKO5k0wVyPtcGo/J KIIYBN9XWZtIwCYEZXkXhML6AKdVIlkAx64SdqbpdMlYd6zNTZ5mwI0TO5GLRJD/RVXn T1lgyS2IjxGHdnyhXGFo+tv/hqdljG5u6U9xbjZINXewG8SXqMRPuN4KQS8oe3kC8Ul6 B5lQ== 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=ktfcqSBRe8eRK5A5gzbgUANLuCVChHFFCI/4vtIw9Fw=; b=WCwib0INlWguHtTEUzDUCyP/okQTXx114pLAgvK0zh1HcU1uzU8+KEOLqgbLenylth TShJW2nXwpcl7J4Eqsm1YTz7ulGSZF2ZPYk+iMuGQ/he/HNiqqbjdH7coZZPNh5TqsLB X4pZGLc+RZrH9cCl4U4JWLezsdc0kgYQSSxoWh2ZUYzOgzuMoFZCFd4vkU5wPBJD7d6R Ogq0YptYorzw5zEXPh2Vg2YtrTQQagw2zimnOpnNaI69/yQeR16EpLJZPenAx7hXWCJK RxjSQzjDqxr4Pxk2WdXKv7KtUWkXclkE26fkBoLxWf7KqoGSIu5vOdHWR5ni/wJhh/h9 KUWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=Z8xfJu6e; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m24-20020a1709062ad800b008dd8491f9f8si11916610eje.118.2023.03.08.00.45.12; Wed, 08 Mar 2023 00:45:35 -0800 (PST) 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=@walle.cc header.s=mail2022082101 header.b=Z8xfJu6e; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbjCHIWK (ORCPT + 99 others); Wed, 8 Mar 2023 03:22:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbjCHIVW (ORCPT ); Wed, 8 Mar 2023 03:21:22 -0500 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 660B3144AF for ; Wed, 8 Mar 2023 00:20:53 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id A73E216FE; Wed, 8 Mar 2023 09:20:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1678263632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ktfcqSBRe8eRK5A5gzbgUANLuCVChHFFCI/4vtIw9Fw=; b=Z8xfJu6e78pT1XFtaYdWug4JDZB8LYDQj0qyNdu9780y1EN7Z/O9wigVQ0VR07GfTzM1Q5 wFdBO7Q+0X8DzEbai2KJusBhyyGVU7Ikai4M8417Vm00dFkOhhHlrpNFjVVu6enyNQYz2P y3YShXURejpkbG+Xc7dUWobXW62+5wEJSVkZLn+5t3FMa91V8B7uKuzEAr5I30iwbQMNNF yOzj5NQ0NWOBUf4tT4OBoBJ7SK+cDMxwjJ5LJB8GNfSFG0UvlKOPYiTDsnZXNDnIWMUunz XroHmi+w1bpARuCpoio/PtboD11Prcfx5fPB8L70F8IIQEH4KuFbdVG1rpjEHg== From: Michael Walle To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH v2 4/4] mtd: core: prepare mtd_otp_nvmem_add() to handle -EPROBE_DEFER Date: Wed, 8 Mar 2023 09:20:21 +0100 Message-Id: <20230308082021.870459-4-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230308082021.870459-1-michael@walle.cc> References: <20230308082021.870459-1-michael@walle.cc> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759788543156978237?= X-GMAIL-MSGID: =?utf-8?q?1759788543156978237?= NVMEM soon will get the ability for nvmem layouts and these might not be ready when nvmem_register() is called and thus it might return -EPROBE_DEFER. Don't print the error message in this case. Signed-off-by: Michael Walle --- v2: - none drivers/mtd/mtdcore.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 0bc9676fe029..83a22566a8ce 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -953,8 +953,8 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd) nvmem = mtd_otp_nvmem_register(mtd, "user-otp", size, mtd_nvmem_user_otp_reg_read); if (IS_ERR(nvmem)) { - dev_err(dev, "Failed to register OTP NVMEM device\n"); - return PTR_ERR(nvmem); + err = PTR_ERR(nvmem); + goto err; } mtd->otp_user_nvmem = nvmem; } @@ -971,7 +971,6 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd) nvmem = mtd_otp_nvmem_register(mtd, "factory-otp", size, mtd_nvmem_fact_otp_reg_read); if (IS_ERR(nvmem)) { - dev_err(dev, "Failed to register OTP NVMEM device\n"); err = PTR_ERR(nvmem); goto err; } @@ -983,7 +982,7 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd) err: nvmem_unregister(mtd->otp_user_nvmem); - return err; + return dev_err_probe(dev, err, "Failed to register OTP NVMEM device\n"); } /**