From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 60A48390226 for ; Thu, 13 Aug 2026 08:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786610164; cv=none; b=XF88flIphRNWjbQqnUI3lkxHRdsCfPTQvnX/inBUXpsM/hBv0MJ3IS6n7+Ek2roENIquvZE4HgWtddyLnbV51KfcN7qXw3I5FPJNFdF1WOdYs2peFfZ/uXfd/hSK1DHF8IbB7rsjGhNS2RkA4RAuuFYxbmKvsqA5lGRNO3WUDCU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786610164; c=relaxed/simple; bh=iZGuI2jZEXcez21BvMLyyL5J5TyyPpxYgd+5RltvGbE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WeZoviVfocGSjLYCIU4vRuhuQk6ej2Rc87AMOEv/WDOLR5uadZOWRSnWKZ2yo6PY83hhQCZ6qG0/SEmnFkUaTVVmvXw06JtkFwj5klAujUdoydlZXo3wXmGvnz33rk40scCTfPdS9q1E9zbJ04Htu3cNe3st5kAWAIuzgcvlzcw= 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=qbFoo/Ro; arc=none smtp.client-ip=209.85.128.41 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="qbFoo/Ro" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-493b966dd74so2934845e9.3 for ; Thu, 13 Aug 2026 01:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786610158; x=1787214958; 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=/6xfzqPrssPk1eiQCa0fxb1om8jeBEn9170ILCiYQUo=; b=qbFoo/Rogh6FZqCSva0ejfA7WOFQt56sG/mcwYgKCMj8/qLBam/AzIQ0uBKAfnmXnX rAkinM9dIYDsI1Dmxp5/yAJ6KIufNFu7/eK51SP+OiEbRtUx/UV4eR63sAJote2XyDC6 6PcrigW9btCwpavtxPOKtOcr+YYG7KbpII/6Wmd7my3d9VJjdwIJL+qEd9Bo/gO0lDVD GP5AIyXOK0QQwI7dVHkG4dciBJrjCN6Izx6XxXV6J1HBIIL1nKLPtRZRUWMyAzrXV2jq pzxUK93V1MoB9K1Vtc8nIL6MQDPm/+jUCd84WVR+Xwpr6C8gsotzm3cGYKyUJ8Lu4i5u x0BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786610158; x=1787214958; 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=/6xfzqPrssPk1eiQCa0fxb1om8jeBEn9170ILCiYQUo=; b=O1fd5bJDi8BnYCJH9x+E9XCRik+vC4zHMk6cGGdXoJtZXwLEMmvHOpYporw277UkMA f2Qz81hPQYUeA8MaJmHe8LdQcoYb0o8OYw30rNLp6gDoAatldYrecpMhizx0byvZ5CIO 9ijzqauGhc1ywwoulueduacl4RqI9OtkcnVobM9LU1pQ1pjqv0kT2F8dMJmJ6FkBPj9d 7SFOC4EKpW0V2bMgv8jojxCT9pfSMW/JDtpLB9cVrB9BQwKeCLpbPBEpedGAr0x/vFDK XaihNbCwZB9ByL+AXDG2q2tO9f/3KhJy7+pP6K464iuNf08MjYPSv4jrOJh24xR18jpI k6mA== X-Forwarded-Encrypted: i=1; AHgh+RqLUeQgWyEhCwz2pt2GvUpTPI/d5wYkFCPYH02yt30VxLLdrazbsUniNO+wOKvOOJ6mMDqhEq8YFJLYmVQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyeXG7DdPe8h6kowkswSR9F2DLJsrfSO6f/EaWfzC3fUuhQrQiq JoD8OlrqO0U1aw27LcLtr9WxvWDP0K8xXt6fUfMxf4PUltLNL/NhU3K3 X-Gm-Gg: AR+sD13Q9CWkf6kpvhn4Jgdt4M1PyXnS6lnCC+C9v9Q2tlvb3kpt0crDfdSmaTxn/Qw 8KtPVi/2y+mbEFrzbtqL+k5mJqDGoqXp4PcqAP8Yd3UW0lS2v95CZdw5be/zVkGkortedeJbXKC 6sj7xN9s4+WsuNJsIA3yGVAHJX9su0TP6S7e/TGiIDVof5x9SZgO7VmnS118DUkjV+7rB8XtEJH Acjn3JA7zJ4qOlQocn/3WDQ0bLNqkpDqB7FXbBemwY/YCjnptiIrjCgg/k+ZeYQ4lbr1yzaDHin 8//6728/C/kWkWhl03Bz2e8jS3or+u+EavEoism3dOr+YCcmUYrcHy1KeDruAmz0YxTre+Kbz5G KnKOpOoUonFMytM40olzGXbGg3yQXQ0lbMfK3FXKSs02HDtwaF+Jvh+lHjJNlMHY7jT88RmdSsk bbFgCaN0JSyQv9VEo/vX52NMW3pT8zxhr6SVAh3AEe8eRzQLDf2RKyj/kTzlQTx5YIoyndFO1R3 57cTZQc7BZBCAmR7io3hSex4iIOlhDqbpvdiJW3oN5y3bt+ X-Received: by 2002:a05:600c:3553:b0:499:7ce1:d8a2 with SMTP id 5b1f17b1804b1-499821d1379mr41303605e9.8.1786610157531; Thu, 13 Aug 2026 01:35:57 -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-4998216d082sm45804425e9.13.2026.08.13.01.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 01:35:57 -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 v14 04/12] net: phylink: save phylink instance fwnode on phylink_create Date: Thu, 13 Aug 2026 10:35:09 +0200 Message-ID: <20260813083536.970196-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260813083536.970196-1-ansuelsmth@gmail.com> References: <20260813083536.970196-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 6204e3bba16d..82eae20daed0 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