🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #1444

[PATCH net-next v18 04/12] net: phylink: save phylink instance fwnode on phylink_create

#1444
From: Christian Marangi
Date: Fri, 09 Oct 2026 18:28
53 lines
9559 bytes
The firmware node associated with the phylink instance might differ from
the device firmware node passed in phylink_config as such device can
reference the parent switch or other platform peripherals.

Some function might need to reference this firmware node after
phylink_create so add a dedicated fwnode entry in phylink internal struct
and save it on phylink_create().

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/net/phy/phylink.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 1156e6c61a08..9441afe372c3 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -44,6 +44,7 @@ struct phylink {
 	const struct phylink_mac_ops *mac_ops;
 	struct phylink_config *config;
 	struct phylink_pcs *pcs;
+	struct fwnode_handle *fwnode;
 	struct device *dev;
 	unsigned int old_link_state:1;
 
@@ -2115,6 +2116,7 @@ struct phylink *phylink_create(struct phylink_config *config,
 	INIT_LIST_HEAD(&pl->pcs_list);
 
 	pl->config = config;
+	pl->fwnode = fwnode_handle_get((struct fwnode_handle *)fwnode);
 	if (config->type == PHYLINK_NETDEV) {
 		pl->netdev = to_net_dev(config->dev);
 		netif_carrier_off(pl->netdev);
@@ -2199,6 +2201,7 @@ struct phylink *phylink_create(struct phylink_config *config,
 		pcs->phylink = NULL;
 	}
 free_pl:
+	fwnode_handle_put(pl->fwnode);
 	kfree(pl);
 	return ERR_PTR(ret);
 }
@@ -2229,6 +2232,8 @@ void phylink_destroy(struct phylink *pl)
 		list_del(&pcs->list);
 	}
 
+	fwnode_handle_put(pl->fwnode);
+
 	kfree(pl);
 }
 EXPORT_SYMBOL_GPL(phylink_destroy);
-- 
2.55.0
Technical Details
Message-ID: <20261009182836.50631-5-ansuelsmth@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343880-linux-kernel-netdev=dewy.ru
References: <20261009182836.50631-1-ansuelsmth@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343880-linux-kernel-netdev=dewy.ru
From: ansuelsmth@gmail.com (Christian Marangi)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v18 04/12] net: phylink: save phylink instance fwnode on phylink_create
Date: Fri,  9 Oct 2026 20:28:00 +0200
Organization: Usenet Network
Message-ID: <20261009182836.50631-5-ansuelsmth@gmail.com>
References: <20261009182836.50631-1-ansuelsmth@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1172436"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CgedVIwWUPAf0xS3TNdXQ9bFJI8= sha256:+hweDvpW+R29DU84KPU5PBh58IbxOKo5om5VdjaaQcg=
	sha1:5zVqjhqsuZvyKyKEznlCrP+LVSY= sha256:9OhYJUtvE0ShHnm6i7NmRsZoxgNb8gxjCXhGU1odpF8=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id BC39F10F5AC; Fri,  9 Oct 2026 21:52:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.849
X-Spam-Status: No, score=-0.849 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 1VvzJZnSc5VU;
	Fri,  9 Oct 2026 21:52:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-343880-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id F3A4510F792; Fri,  9 Oct 2026 21:52:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id 92F4460FC79; Fri,  9 Oct 2026 18:37:38 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 809B450128F;
	Fri,  9 Oct 2026 18:29:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GmTrLDb1"
X-Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3695B4FECC6
	for <netdev@vger.kernel.org>; Fri,  9 Oct 2026 18:29:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791570551; cv=none; b=oRW6U2734LdO6HP67rkCKZ0Z2KvPpptJFvUBOMC46hhD5T622aQHJJdy7rCeiAwZGelA/40/8WMxQ/nfA+nFqsD6UNAMjvaJ1rP7zBHx6sLsArAda9yKCyy5rfJS0b/No3ThiySeaTdmtCW2FreAMe7Lt98P6TMFzVK1zmLfzRk=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791570551; c=relaxed/simple;
	bh=m5HqqAwvf714jhn9AtFujlH/Cfft9cIXbM/MO6suoWc=;
	h=From:To:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=kUti43gT2rIxC2Z0Oa3aDWsgdSJRD1ouGr7NaY8yLs+D4zVU/d3fqSsoY2/I/+EQLIAe/46J3NyXgsDdh2QE/jK5uwdZbIuxQdvujEicM/mE9V5/2kZrR5s4lFCdcdkmeC3DJbFnTXarrbpcvWyuao86p3tFfrSWbmnu/3h847k=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GmTrLDb1; arc=none smtp.client-ip=209.85.221.46
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-48c4d870d54so58116f8f.2
        for <netdev@vger.kernel.org>; Fri, 09 Oct 2026 11:29:04 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1791570543; x=1792175343; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=VDqbFLObsehCe0sJ0clGiEdbuZFFJjsJjNFUc+Lf4xc=;
        b=GmTrLDb1MWwldnZ3d2c5G45p4fXiG+jIr8tqArrqf64NbatwXybyHqRyyu+RWOuvf5
         ootpzgbp/S2vMiBIiV4pIgYS/KiReRONIYhtQ+n8vkKO+wqkjcMnCVSmUnP8x/fz6lAx
         23jb9FyUmeGr4XCrIrnm0LHwFH7uluWyl06L/TSsP6wzeQopWCHkTHV9VXI9sHsrhjTy
         WYoDXIpa23jNALo169N3EtG8MkzwfNxxbFGNXDG7GyLCqk6k0sovJwvAYASDYkN1Ncnx
         86MCfWVMkUoyQTjpeszKZLfZ1vZ7qznDJuZrE488FAPK+8QFdDBRkUlvOmdIL9SD6vIR
         RxRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1791570543; x=1792175343;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=VDqbFLObsehCe0sJ0clGiEdbuZFFJjsJjNFUc+Lf4xc=;
        b=kjyIvI170LMxvtXlvaXNG1EzjDmlzI5F0INwlJD0FRSaq4eKpWak5cAbLt9x+25meK
         GRiGcbAiJvBkztRR0t7ZFSNte1Kpf0oitryAgdTWiEjZsyMyEJ9wqlJ5jcuEMQnO9HZk
         hVqQlz8Q7+zemUIv0A8bKZpP6wNS5LZpJUh7AEc2ZA9n6y6Ml+q20xexYlWC0wCF2zC3
         0ySfBZlME4WzOeeW8cXHtLHcN2sTlfLlXifbSuC4KP3XX1h0m2q1pYe1f29Snj5/ZNE6
         Kr42XZFyQ3u+UFnZxUDfd44anW0XY1HxmaEKnsrZq1hdOVmzR+ICbjh13azkOKO3rp5+
         oGAg==
X-Forwarded-Encrypted: i=1; AKwUvBzTQq/HuZwQQwpw47VjXA2jQIiAkznlAhbksuPBey9Ix0WcUVWM2B/AVE5x9WrIyNAXGnY8otc=@vger.kernel.org
X-Gm-Message-State: AFq9FYJAbsSWk3DZ34N76wG7jML6tnlnV9RUq7ZzUaWEUcF4XZqUEEGi
	UHYyw6HOGRPdzJTSm4bA546SJycU56TleiY4FB1ogHJOSmZQx4UuVkkb
X-Gm-Gg: AYBFou21c6dHVtYNVSZqa7Ih6XeqjRGRuXc8OqxrRJOGzC3pHSoxhI2SmrqfmOFdXXE
	UDpIs78t+r0pluxAJcIypRg6B46WshRVeg9KQZvQC03/BkOe8DZec15Ql3KA8uGfy05Ls+WEeMe
	KeuW5Ljh/Q9CKwg+5aY0WNKsaxMVZnw/NaxYHaUhdgujVHH+Lw+zHraudfvbYtniydDDAJ/xWUR
	xqgbdwkW5ErxmRa55Te0jX6r7LbKdiiFy574EnjfDKxe/B3yubT7+mNh8n643kM/m6uUrZ9s8n6
	J+R3NRXXXsVtNMX8I2rBLsWKbYUYbVpZMi7ooI7AMXFiLuL5s16lJ7GvyeXD29uxpK8Z2oZV5NU
	Bo1LcMOKVtMh2gVHiIZ9CLnYi2JcZpyAOLSZgjsF0RtJZbgfnRXRI3ufbSe8p4EKoPfSHmZMYBI
	Ifsy6E3D1tK3exiEu3z8uoW5czofF76R4U5Px7/ybZeGN3LgYsFS2bbmW71toBdV/8qyzR3R/K/
	XKUD1fawwBI2/ip9XLU7YnFzVtCL7gHPYhWBCuXOibH4b2rVRAFE0oJjHLhn5FCHE1ocgBIz2WJ
	WpNq9ZLs3Rw/27ktug==
X-Received: by 2002:a05:6000:25ee:b0:48b:e50:715a with SMTP id ffacd0b85a97d-48dbace01abmr5330100f8f.34.1791570543097;
        Fri, 09 Oct 2026 11:29:03 -0700 (PDT)
X-Received: from Ansuel-XPS24.localdomain (host-213-45-9-252.retail.telecomitalia.it. [213.45.9.252])
        by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-48db9adf5e6sm5037794f8f.56.2026.10.09.11.28.59
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 09 Oct 2026 11:29:01 -0700 (PDT)
X-Mailer: git-send-email 2.55.0
X-In-Reply-To: <20261009182836.50631-1-ansuelsmth@gmail.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>