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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF2DBC61D88 for ; Tue, 21 Nov 2023 00:57:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232855AbjKUA5f (ORCPT ); Mon, 20 Nov 2023 19:57:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232696AbjKUA5c (ORCPT ); Mon, 20 Nov 2023 19:57:32 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5536AD9; Mon, 20 Nov 2023 16:57:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=A8vz8TaYFW7rrQPE0TRvK3Ar7EWIRyR4z4redBV7BfE=; b=uOvoVaCjQvPcT6g1+O0TAssver UJpoOtZyKIiJsPGnusZiXNozXHlD/FkuqvdCF6el+hAy10z1R7fssEYFkaMzYCMf6dhyWVNEHvfJ8 HZhNsr6txQPQRl8sQE6sX+/fsVR9MeKp9BfK5qMXHtlgH2nLP/7U7n68qwc7i8MR47/Y=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r5F4u-000hxy-3U; Tue, 21 Nov 2023 01:57:24 +0100 Date: Tue, 21 Nov 2023 01:57:24 +0100 From: Andrew Lunn To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?iso-8859-1?Q?K=F6ry?= Maincent , Jesse Brandeburg Subject: Re: [RFC PATCH net-next v2 03/10] net: phy: add helpers to handle sfp phy connect/disconnect Message-ID: References: <20231117162323.626979-1-maxime.chevallier@bootlin.com> <20231117162323.626979-4-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117162323.626979-4-maxime.chevallier@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +/** > + * phy_sfp_connect_phy - Connect the SFP module's PHY to the upstream PHY > + * @upstream: pointer to the upstream phy device > + * @phy: pointer to the SFP module's phy device > + * > + * This helper allows keeping track of PHY devices on the link. It adds the > + * SFP module's phy to the phy namespace of the upstream phy > + */ > +int phy_sfp_connect_phy(void *upstream, struct phy_device *phy) > +{ > + struct phy_device *phydev = upstream; Will this function only ever be called from a PHY driver? If so, we know upstream is PHY. So we can avoid using void * and make it a struct phy_device *. Andrew