From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 C947A3D7D94 for ; Sun, 9 Aug 2026 20:31:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786307502; cv=none; b=Li6W+WT5AYtUlL0cCjO+/2KRbKElgV3JyXOwOhXFZBzmo8wLgCAR54hZFI0or6++TqmkAlNz2f0wQSvuEf6E609hDyU70CeF6HpaPnQrTMqGkj6wMeoAndR4Ljk3SrvL68y1hNipiWb32oxIJlyCaLI0fGuCQmMWAIBCu5cKTHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786307502; c=relaxed/simple; bh=uxeJVrns8QwyjSHCN9EiUaTLmLVR3PlKWthj3ETOI48=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E9kASXwKimCEmSeA0Got/tkNGBQE/nObC+yZJ6YDvLEHRa39f/qsUciEz9nLRssvyj5VUPRFCUSeObckfTuGT7LzVLbajUXmDYhVezRLgcgo32kAc/Arev/By1ue+Hfi1th4KbBL0XHuzzLcy5jGVmLDGannkbl2/bhQVJkSfxc= 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=PLiBv2cL; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PLiBv2cL" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4995b0343c1so10775875e9.3 for ; Sun, 09 Aug 2026 13:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786307497; x=1786912297; 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=SDVkGCf+wZIAIn3ijo+C35M8x1Ew0hMLzqVjwMb8SL4=; b=PLiBv2cLekUNdda1BtQ70VYAEkNGXQ0oecVfImuMR6e/2CooDOUMOkwX3+xbxZH4lF vuqSFyms1MUApdd8CcSPg5f5aFuyMOQGMPdYqzHdgXoJoUHdWhdITB/VIeq7U2T05POI Mh6LvY+Xp+ngwrVbDopL/jwvrFLb0QkM1CHpxTcQcdbaYaUDY5pL7+tSEgs7aUkXLDGf 5aaNdEagVgp3uYrzUHJygaKVTaYc73QPvFV/vBrDgudxaTY9Gq5xdAk/J0oGPNJHzUIu vtnndiPiU6MJ3DxjZLiQ55iGSz6t02mE/ztnx9hTq6ChGtGv+QFRIQ2EygbuTK2rzZAW uxMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786307497; x=1786912297; 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=SDVkGCf+wZIAIn3ijo+C35M8x1Ew0hMLzqVjwMb8SL4=; b=JaTId5KGa9CxpVPNu4b3BnA7o5eWartdzP4YjGZTaTFX54jsuFxqHBNGKZYth12e4w 8pUiinOXTDS65NFQGkr0J/oAl3aLtIGCU/fZ4mdj6whAERx5l1MuI524cS12uuruF/Lb 3vK4FnajWOKhpfQK7xuGNUJdklp8GpxGCt5A1Bbhoy0W1L9pqSGyzbzrb9Jw75+d3clc a75Tp1MgP4DBnaISplHCoL/3GK1ADAMfgrynbqx1+Dmggl2wdqTT0DtwPtHpa074QFI7 H2ICoZZRBY1mA140J0/GwWBZ/zkGv/EgpnkT9kUeOXSn6iEdySl0tSX4cTSB2Z3BGRYj NWHQ== X-Forwarded-Encrypted: i=1; AHgh+RqVYE08ZNUICfk23tCiMnA+sMKMoEeTGSTsqQMdhuJzqfoCiSfJZ0hkzMxrBcb9A0sPr5jqaVtZmQzJTIY=@vger.kernel.org X-Gm-Message-State: AOJu0YyhjwJpOiStyqzdxjjBw7i7pZMKVEuGlCiBcbmC9LN42QeWe5/n dIJA2Iz5JZwOH0kJYUuMhZZunkNNRQdfbYarh4xwPgHTaiQVrtewhM0/ X-Gm-Gg: AR+sD11Z/Io70lqI7z+GqnnLuw7uCjwHQ/wvtpmwaHV67/lC+PchTmqoBVd2g8WvM2q aSnbPBGeBLY+HAMJd8a4hniKQY2kxbNDKe4E34+qvERRzbnbmmsqh7cbz+swvBTl/QMtfBvmZfj k2n4/JOu1qL0Wd6MiiGf4u8O7yS7DcKRvPlQw3UPvk2lKOQNL3DySmoFupeoH7cprtse0OBfwCa ZjqvH0Zuoyh1fVV/KA4gvK+B/HvqvWsaWwnPMTvOiCnFy8red2cJn6aG5aIW1DfTh3jvtAWrLLj ue6tFsdqtzrpWPBiiKMOSCr5cfMwid27XBpr9f2OEBAetlwz2ypXQRQTj1azOlkkz24Qw+IolF/ YjqgYIBc3adSqWXIC7CWxk99JEvOWp666egg2IMRZWRrTkU0YEclh6DJW9G651J4SynSfCGnXU9 KLWchdGpP5IQmT0egTAmiWlEslmciUiSU5pERmw8VD/o5qC4yDTRO2wgNWjjbTioKJ1phDlQy9D ULOaUIkziNGQp5+Ukh8klhWcff5ThfF09D6noGYaKzlibOH X-Received: by 2002:a05:600c:198f:b0:492:4e09:9fc1 with SMTP id 5b1f17b1804b1-4994e7cc5a4mr520537665e9.15.1786307496663; Sun, 09 Aug 2026 13:31:36 -0700 (PDT) Received: from Ansuel-XPS24.localdomain (host-87-20-3-207.retail.telecomitalia.it. [87.20.3.207]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4995e9ea92csm229357065e9.4.2026.08.09.13.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2026 13:31:36 -0700 (PDT) From: Christian Marangi To: Maxime Chevallier , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Jonathan Corbet , Shuah Khan , Christian Marangi , Lorenzo Bianconi , Heiner Kallweit , Russell King , Philipp Zabel , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, llvm@lists.linux.dev Subject: [PATCH net-next v12 04/12] net: phylink: save phylink instance fwnode on phylink_create Date: Sun, 9 Aug 2026 22:31:01 +0200 Message-ID: <20260809203116.640271-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260809203116.640271-1-ansuelsmth@gmail.com> References: <20260809203116.640271-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 b69050f22717..b9a5cd123775 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; @@ -1993,6 +1994,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); @@ -2077,6 +2079,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); } @@ -2107,6 +2110,8 @@ void phylink_destroy(struct phylink *pl) list_del(&pcs->list); } + fwnode_handle_put(pl->fwnode); + kfree(pl); } EXPORT_SYMBOL_GPL(phylink_destroy); -- 2.53.0