Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1447767rwb; Fri, 5 Aug 2022 02:00:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR7MohQkupGOL1A9EEzTmVXShA1AeaoVBAy7oVRaF16e74f+x2vHeozu2QSTGYRha4IFXUTk X-Received: by 2002:a05:6a00:aca:b0:52b:bd66:8c94 with SMTP id c10-20020a056a000aca00b0052bbd668c94mr6000618pfl.3.1659690048380; Fri, 05 Aug 2022 02:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659690048; cv=none; d=google.com; s=arc-20160816; b=VaryX47/VeH8N9gESQE3Jx3bzAVNYAFsBx9vik2d3CbjLk9fYUGf96/S9WEZlPu4sB vwo3BKxwo2dNHtZ5XYR0Gra1zMxNPcgyNWwW/2NMjQr7iK9sZ6jyE/1cR75n3JiBGhwr C8x6QG/3zIHTPLOXJd7SJxgUmBTtnxs3MLwLrZ//ywjYozoF5Nn+0GbpMe7we6CFNOXj nN1mW5Nnmz79qYTR+wa+EERsT5tTcYs9BB7B6BfvQw9PqG2p720YZ65rcM7UB1sCMtg5 Lqskq3cQ5Wl+ZmGlCPeA2O6stMfNlDv/uBaax82LJoOJ5CMqaMRTHnW5NBm3JKG0DM3s VSNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=WY/p0AKPurtQC7CbtbT4lh+mfKMDaL2pNRP+3Km3zMw=; b=N2aZGpMRphbtVtU5RrUVWu70HAYQJjEo8E06thf2+nt+bZibywixKStBAeFH/1PJN2 NLBymZ8MILO96c/m4KB0krdBxGB8h+8XYsr2SiF/ZOEDXzIJ/mfJ3Qo4M1WeJ/Vr3BiD tLwT1DV7qStWEyVcnh/wrrXA9xvbejhVW8mVfgKi1eKbJFEK5LBEm39TsHRWulLBg7Ea pBTDd4xGjru0YgN4CPkQJOD8brhubudgP1eMplcQ4djaQCnWtCZwZMBN5Skxolw06Rcd 9SJAxG3wpG6ExafedC1ZH+PuCcYSbNSNtxRAIPhIOWUz1MR000diasQtBrnTx/rSKf++ fXEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@maquefel.me header.s=mail header.b="M6Wi8T/q"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b0041afbe04925si2936255pgq.193.2022.08.05.02.00.33; Fri, 05 Aug 2022 02:00:48 -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=fail header.i=@maquefel.me header.s=mail header.b="M6Wi8T/q"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240209AbiHEI42 (ORCPT + 99 others); Fri, 5 Aug 2022 04:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbiHEI41 (ORCPT ); Fri, 5 Aug 2022 04:56:27 -0400 X-Greylist: delayed 453 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 05 Aug 2022 01:56:23 PDT Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC8CE6BD52 for ; Fri, 5 Aug 2022 01:56:23 -0700 (PDT) Received: from forward103q.mail.yandex.net (forward103q.mail.yandex.net [IPv6:2a02:6b8:c0e:50:0:640:b21c:d009]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 28F5F4ECB2CA; Fri, 5 Aug 2022 11:48:46 +0300 (MSK) Received: from vla5-47b3f4751bc4.qloud-c.yandex.net (vla5-47b3f4751bc4.qloud-c.yandex.net [IPv6:2a02:6b8:c18:3508:0:640:47b3:f475]) by forward103q.mail.yandex.net (Yandex) with ESMTP id 244CB56A000F; Fri, 5 Aug 2022 11:48:46 +0300 (MSK) Received: by vla5-47b3f4751bc4.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id xFBAKgq0sD-mhoWlJ8g; Fri, 05 Aug 2022 11:48:45 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1659689325; bh=WY/p0AKPurtQC7CbtbT4lh+mfKMDaL2pNRP+3Km3zMw=; h=Message-Id:Date:Cc:Subject:To:From; b=M6Wi8T/q+hoGx9dgUAqM+SWXRjHreA5+4/xctMXwI50sdDkbOhIa1lpKCFTHvfkHk wpzCdXZytpZhjjqwUaowRjAbribwdXKZzgWE4v+sJNZNDr1NPFdY7kLskpJJv4X+f1 4VnnWZRwf618e2mUzK2R1P6LWUqOqSVYiG8GwZdE= Authentication-Results: vla5-47b3f4751bc4.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me From: Nikita Shubin Cc: linux@yadro.com, Nikita Shubin , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasmus Villemoes , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: phy: dp83867: fix get nvmem cell fail Date: Fri, 5 Aug 2022 11:48:43 +0300 Message-Id: <20220805084843.24542-1-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikita Shubin If CONFIG_NVMEM is not set of_nvmem_cell_get, of_nvmem_device_get functions will return ERR_PTR(-EOPNOTSUPP) and "failed to get nvmem cell io_impedance_ctrl" error would be reported despite "io_impedance_ctrl" is completely missing in Device Tree and we should use default values. Check -EOPNOTSUPP togather with -ENOENT to avoid this situation. Fixes: 5c2d0a6a0701 ("net: phy: dp83867: implement support for io_impedance_ctrl nvmem cell") Signed-off-by: Nikita Shubin --- drivers/net/phy/dp83867.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 1e38039c5c56..6939563d3b7c 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -535,7 +535,7 @@ static int dp83867_of_init_io_impedance(struct phy_device *phydev) cell = of_nvmem_cell_get(of_node, "io_impedance_ctrl"); if (IS_ERR(cell)) { ret = PTR_ERR(cell); - if (ret != -ENOENT) + if (ret != -ENOENT && ret != -EOPNOTSUPP) return phydev_err_probe(phydev, ret, "failed to get nvmem cell io_impedance_ctrl\n"); -- 2.35.1