From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A09E1FAC for ; Tue, 30 May 2023 06:13:14 +0000 (UTC) Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2D16B0 for ; Mon, 29 May 2023 23:13:09 -0700 (PDT) X-QQ-mid:Yeas53t1685427069t065t27383 Received: from 3DB253DBDE8942B29385B9DFB0B7E889 (jiawenwu@trustnetic.com [183.159.96.128]) X-QQ-SSF:00400000000000F0FOF000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= X-BIZMAIL-ID: 12025745897829443806 To: "'Andy Shevchenko'" , "'Hans de Goede'" Cc: , , , , , , , , , , , "'Piotr Raczynski'" References: <20230524091722.522118-1-jiawenwu@trustnetic.com> <20230524091722.522118-2-jiawenwu@trustnetic.com> In-Reply-To: Subject: RE: [PATCH net-next v9 1/9] net: txgbe: Add software nodes to support phylink Date: Tue, 30 May 2023 14:11:08 +0800 Message-ID: <038901d992bd$863a6b30$92af4190$@trustnetic.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIrQcdiCo7tNEhbaUMwQ6r5o07FvQMfMz0nAm3dY9Ouoo2ZQA== Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FROM_EXCESS_BASE64, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Saturday, May 27, 2023 4:44 PM, Andy Shevchenko wrote: > +Cc Hans (see below) > > On Wed, May 24, 2023 at 05:17:14PM +0800, Jiawen Wu wrote: > > Register software nodes for GPIO, I2C, SFP and PHYLINK. Define the > > device properties. > > ... > > > +int txgbe_init_phy(struct txgbe *txgbe) > > +{ > > + int ret; > > + > > + ret = txgbe_swnodes_register(txgbe); > > + if (ret) { > > + wx_err(txgbe->wx, "failed to register software nodes\n"); > > > + return ret; > > + } > > + > > + return 0; > > These 4 lines can be as simple as > > return ret; This function is going to be extended with later patches, is it necessary to simply it here? > > > +} > > ... > > > +#define NODE_PROP(_NAME, _PROP) \ > > + (const struct software_node) { \ > > + .name = _NAME, \ > > + .properties = _PROP, \ > > + } > > Looking at the amount of drivers that want this, I would declare it in the > property.h with SOFTWARE_NODE_PROPERTY name. I'll Ack that. > > Hans, what do you think?