From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbdJRLNB (ORCPT ); Wed, 18 Oct 2017 07:13:01 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:10908 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752536AbdJRLM6 (ORCPT ); Wed, 18 Oct 2017 07:12:58 -0400 Subject: Re: [PATCH] phy: Return NULL if the phy is optional To: Maxime Ripard References: <20170904125313.21159-1-maxime.ripard@free-electrons.com> CC: From: Kishon Vijay Abraham I Message-ID: <796c0230-d018-e3e0-23d3-9f5f2406e5e3@ti.com> Date: Wed, 18 Oct 2017 16:42:51 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170904125313.21159-1-maxime.ripard@free-electrons.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 04 September 2017 06:23 PM, Maxime Ripard wrote: > If we're trying to get a handle to an optional phy, then the phy framework > being disabled shouldn't return an hard error. > > Instead, return NULL just like phy_optional_get does when there's no phy > provided in the DT. > > Signed-off-by: Maxime Ripard merged, thanks! -Kishon > --- > 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 78bb0d7f6b11..76487b8d74ea 100644 > --- a/include/linux/phy/phy.h > +++ b/include/linux/phy/phy.h > @@ -289,7 +289,7 @@ static inline struct phy *devm_phy_get(struct device *dev, const char *string) > static inline struct phy *devm_phy_optional_get(struct device *dev, > const char *string) > { > - return ERR_PTR(-ENOSYS); > + return NULL; > } > > static inline struct phy *devm_of_phy_get(struct device *dev, >