Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2228682rwb; Thu, 19 Jan 2023 23:26:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXv7LMrDmXt6WGil4t/79Zfa9GnY8R65Eher7u2zdnV2Jo1rKuWvvfPNsCDp2uH5UokvVv1N X-Received: by 2002:a17:90a:dd98:b0:229:8526:ba98 with SMTP id l24-20020a17090add9800b002298526ba98mr14476752pjv.12.1674199607692; Thu, 19 Jan 2023 23:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674199607; cv=none; d=google.com; s=arc-20160816; b=e2/ssdqqmGcVXX8evmLV6329ON/2XYEf7iqo8uhpq82rFXjP/9fFLio7T8WKxzf6YM GpxmB44lU2ANkPKNKr4WtjG6+cthPAivcnnzVEC74FKBD54IStC/hTjT7ZsbjYcVQBl+ hnZtzbF9srkN8MCFIPlieLvx3KHQSpWTskFHfbqhOnlXoOO4v9hXesDjXK+8pjq4vv1/ gmj+zKTtZM+5rgC7x0MfgqGvVcDoBUNsKCYWwYDCh12Lyur35xnDjSEtnqRY+IgnWdIQ pb9wuDxGP4+5+5QwN0VgpY/kwXnGR6f8Fo3BfptIemh2L6KEqOU+pEfgxSBGsbK4kJBY UH6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cCn7TNWCEJ/8u3JfvpvdnCbIe1K0xbqGxTofxdSi4iE=; b=ljbXXDa8JovHw04V7EMASqoXC3KS0SLTE+KZWCtpqUUW5kXx3oYLR+F6k+8hEwWl7P ueIODxC/bMf+8FSJFZKtjjgMMwlI7az7FI2n1Fa9HzI4ELyD2T7+YTV7Iy4fZ7e4oyKF wPu3s5hhOGB3ZjEEtaisKu2JxI2S3W7pJZ2WZNmSvlXX1zvFwWLNxq226Lj15pyTwCBC JZmsSMlzmzMcVcBt8vvkwp36aE1rLqDdWYko6HriOiqdfofIBQWG4r4crDCq0B8YHTC7 eyNWGjyQibAGEohd0OkBSaf0Qsj3IHK2+glPn/p9y3TCdKC3Y9GJu/A+uXsqFOPygGQc 3fgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4Nc3EDd; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a17090a8a8a00b00225dacb5818si1548264pjn.86.2023.01.19.23.26.41; Thu, 19 Jan 2023 23:26:47 -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=@kernel.org header.s=k20201202 header.b=s4Nc3EDd; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbjATHLU (ORCPT + 47 others); Fri, 20 Jan 2023 02:11:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbjATHLS (ORCPT ); Fri, 20 Jan 2023 02:11:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF38530D7 for ; Thu, 19 Jan 2023 23:11:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7037D61E2A for ; Fri, 20 Jan 2023 07:11:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 104FEC433D2; Fri, 20 Jan 2023 07:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674198675; bh=ruN1axoeesLkwpizVlQSezOYj0g97Z2CA0toTiAowkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s4Nc3EDdT9+NsuR0dqwZmho96bwdIryMHGcPgkzRX8rIixs38DtpJk4qpO6NjNKQO AlCLw/1l8gFrahmjqQuMn8LM4NptHXP73DYwSfmWEiV5QhCKclRsShybPQ8qOE4JiM fT5x/wntGrk7AF3XD7hPLjKBqvi889HsIe1OwLu77/yrdpnD7T4FaD1R77gKiSoAIU iWS4fmY9DVjnqoi5oWzqW+MUPlGf4jPAw948oLkU0EzI0mAOQWXmmAW1Vn1u9im/BR nAFgFhKf3EkNE+vBF+vHXkzl1lgnMgVauTKYt1cbCca5GRoKZZiyGtKNpmO8BCUuox TQ9WCCRWN1VJQ== Date: Fri, 20 Jan 2023 12:41:11 +0530 From: Vinod Koul To: Geert Uytterhoeven Cc: Kishon Vijay Abraham I , Maxime Ripard , Andrew Lunn , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: Return NULL if the PHY is optional (part two) Message-ID: References: <663dfcec9f703c41759dcd4cd824d00caa2dd5fb.1674036031.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <663dfcec9f703c41759dcd4cd824d00caa2dd5fb.1674036031.git.geert+renesas@glider.be> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On 18-01-23, 11:02, Geert Uytterhoeven wrote: > 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? Ack, devm_phy_optional_get() is used by bunch of folks, but not this one, so lets retire this > --- > 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 -- ~Vinod