Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6259117rwb; Wed, 18 Jan 2023 03:12:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXvGU3ryqvs7JWr/bHQ5Cnvd0Z+RYpJRqvzXnwI+d3QEB4TGASkE64l7LX8gmGZ5QTVWHFHR X-Received: by 2002:a05:6a20:be03:b0:b8:5813:e700 with SMTP id ge3-20020a056a20be0300b000b85813e700mr15312907pzb.3.1674040368329; Wed, 18 Jan 2023 03:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674040368; cv=none; d=google.com; s=arc-20160816; b=HMK4vqHEz71n0ufVveMXVVgVTf0wx1Zp+P2UULqg6Asb9UwmJWUUb024tpJHD5YEcN WduxOm8bc4KC3JFWsL14jU5hvIQNRZ4TxUOfXpUiPv59ZYJbIgo0T7w3LnYyat1bdXFC YVyyaLAsWNOOFrPB3uySk/BkwmvNBronjuLf3YiO6gig86Uz7QciKlkbMcMg+Duz5cJE fXQrl61fhUD+/bdKdGcoacmyoV/LIjSKc7ApvIHDJOikTg1kLibR1KxhJu2u6Wj+9P3f u8VZaKySWzH6bfx5Ovl+IXHsFP9qIBIfperlK2DJHHtISFWImettQO2wHgpo02MiB3Ju wOoQ== 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 :message-id:date:subject:cc:to:from; bh=lUA1ky0lPQCRFoE/22ArciCl1rDOQApKnzIjLJRDnw4=; b=SBGTPbRR1aRztbw8ybsRXjo2kJ/Gj0KU6VO40+7THChYNeMvgPsY4fCHXLGh0AURCn 5kIzdaMUw5mOw/lf8i2Vx6EmB71AaRmvQ28WsfjgJLM+ZvDGk44fd8LRKAE7ceL4KEWn eFaX3wGmZwmGSWrLz9T3WsKReJ3em3DWR4fHlCLg+lhsCFDw0R0Fpgif4bqwCDa7Ancd QIluoijydutQOVfvXvlf0GNR6nSmGDi5/7k0qC/o+2l0SaJdOTnEO1AfOSpdeggOTd1i /5MJ0KIExbkX/pN4dLJAIPw7uFjV5eF0jlI6n+0KiCNo9N6+GzrDCMRnZB79MYnUJqBO xLCA== ARC-Authentication-Results: i=1; mx.google.com; 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 201-20020a6301d2000000b00461b7568ad2si9960829pgb.527.2023.01.18.03.12.42; Wed, 18 Jan 2023 03:12:48 -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; 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 S230130AbjARK4g (ORCPT + 45 others); Wed, 18 Jan 2023 05:56:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbjARKxH (ORCPT ); Wed, 18 Jan 2023 05:53:07 -0500 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6179488756 for ; Wed, 18 Jan 2023 02:02:22 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed50:4745:2e6d:e3a6:3327]) by laurent.telenet-ops.be with bizsmtp id AA2F2900N2zf9gW01A2FTg; Wed, 18 Jan 2023 11:02:19 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1pI5Gj-005aHF-Rw; Wed, 18 Jan 2023 11:02:15 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1pI5Gp-001JHm-5C; Wed, 18 Jan 2023 11:02:15 +0100 From: Geert Uytterhoeven To: Vinod Koul , Kishon Vijay Abraham I Cc: Maxime Ripard , Andrew Lunn , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] phy: Return NULL if the PHY is optional (part two) Date: Wed, 18 Jan 2023 11:02:12 +0100 Message-Id: <663dfcec9f703c41759dcd4cd824d00caa2dd5fb.1674036031.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE 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 If we're trying to get a handle to an optional PHY, then the PHY framework being disabled shouldn't return a hard error. Instead, return NULL just like phy_optional_get() does when there's no PHY provided in the DT. Based on commit 11a6e41c0ee503ff ("phy: Return NULL if the phy is optional"), which did the same thing for devm_phy_optional_get(). Signed-off-by: Geert Uytterhoeven --- It seems there were never any in-tree users of this function since its introduction in 788a4d56ff378bff ("drivers: phy: Add support for optional phys") in v3.14. Perhaps it should be removed? --- include/linux/phy/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index b1413757fcc3b89b..559c3da515073697 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -429,7 +429,7 @@ static inline struct phy *phy_get(struct device *dev, const char *string) static inline struct phy *phy_optional_get(struct device *dev, const char *string) { - return ERR_PTR(-ENOSYS); + return NULL; } static inline struct phy *devm_phy_get(struct device *dev, const char *string) -- 2.34.1