From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C496C433DF for ; Sun, 18 Oct 2020 17:52:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2560B22255 for ; Sun, 18 Oct 2020 17:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727110AbgJRRwY (ORCPT ); Sun, 18 Oct 2020 13:52:24 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:33460 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbgJRRwX (ORCPT ); Sun, 18 Oct 2020 13:52:23 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kUCqw-002L6c-Mn; Sun, 18 Oct 2020 19:52:18 +0200 Date: Sun, 18 Oct 2020 19:52:18 +0200 From: Andrew Lunn To: Ard Biesheuvel Cc: netdev@vger.kernel.org, Jassi Brar , Ilias Apalodimas , Masami Hiramatsu , Willy Liu , "David S. Miller" , Jakub Kicinski , Masahisa Kojima , Serge Semin Subject: Re: [PATCH net] netsec: ignore 'phy-mode' device property on ACPI systems Message-ID: <20201018175218.GG456889@lunn.ch> References: <20201018163625.2392-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201018163625.2392-1-ardb@kernel.org> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > --- a/Documentation/devicetree/bindings/net/socionext-netsec.txt > +++ b/Documentation/devicetree/bindings/net/socionext-netsec.txt > @@ -30,7 +30,9 @@ Optional properties: (See ethernet.txt file in the same directory) > - max-frame-size: See ethernet.txt in the same directory. > > The MAC address will be determined using the optional properties > -defined in ethernet.txt. > +defined in ethernet.txt. The 'phy-mode' property is required, but may > +be set to the empty string if the PHY configuration is programmed by > +the firmware or set by hardware straps, and needs to be preserved. In general, phy-mode is not mandatory. of_get_phy_mode() does the right thing if it is not found, it sets &priv->phy_interface to PHY_INTERFACE_MODE_NA, but returns -ENODEV. Also, it does not break backwards compatibility to convert a mandatory property to optional. So you could just do of_get_phy_mode(pdev->dev.of_node, &priv->phy_interface); skip all the error checking, and document it as optional. Andrew