From: Herve Codina <herve.codina@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
David Rhodes <david.rhodes@cirrus.com>,
Linus Walleij <linusw@kernel.org>, Len Brown <lenb@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jic23@kernel.org>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>, Dan Williams <djbw@kernel.org>,
Lizhi Hou <lizhi.hou@amd.com>,
Herve Codina <herve.codina@bootlin.com>
Cc: driver-core@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-sound@vger.kernel.org,
patches@opensource.cirrus.com, linux-gpio@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-cxl@vger.kernel.org,
Allan Nielsen <allan.nielsen@microchip.com>,
Horatiu Vultur <horatiu.vultur@microchip.com>,
Daniel Machon <daniel.machon@microchip.com>,
Steen Hegelund <steen.hegelund@microchip.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH v7 2/8] drivers: core: Use fw_devlink_set_device()
Date: Mon, 11 May 2026 17:59:22 +0200 [thread overview]
Message-ID: <20260511155930.34604-3-herve.codina@bootlin.com> (raw)
In-Reply-To: <20260511155930.34604-1-herve.codina@bootlin.com>
The code set directly fwnode->dev field.
Use the dedicated fw_devlink_set_device() helper to perform this
operation.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/base/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index bd2ddf2aab50..5c9a34aaefe1 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3684,7 +3684,7 @@ int device_add(struct device *dev)
* device and the driver sync_state callback is called for this device.
*/
if (dev->fwnode && !dev->fwnode->dev) {
- dev->fwnode->dev = dev;
+ fw_devlink_set_device(dev->fwnode, dev);
fw_devlink_link_device(dev);
}
@@ -3859,7 +3859,7 @@ void device_del(struct device *dev)
device_unlock(dev);
if (dev->fwnode && dev->fwnode->dev == dev)
- dev->fwnode->dev = NULL;
+ fw_devlink_set_device(dev->fwnode, NULL);
/* Notify clients of device removal. This call must come
* before dpm_sysfs_remove().
--
2.54.0
next prev parent reply other threads:[~2026-05-11 16:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
2026-05-11 15:59 ` [PATCH v7 1/8] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
2026-05-11 15:59 ` Herve Codina [this message]
2026-05-11 15:59 ` [PATCH v7 3/8] pinctrl: cs42l43: Use fw_devlink_set_device() Herve Codina
2026-05-11 15:59 ` [PATCH v7 4/8] cxl/test: Use device_set_node() Herve Codina
2026-05-12 8:26 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device() Herve Codina
2026-05-12 8:27 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 6/8] PCI: of: " Herve Codina
2026-05-11 15:59 ` [PATCH v7 7/8] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
2026-05-11 15:59 ` [PATCH v7 8/8] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260511155930.34604-3-herve.codina@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=alison.schofield@intel.com \
--cc=allan.nielsen@microchip.com \
--cc=andrew@lunn.ch \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=ckeepax@opensource.cirrus.com \
--cc=dakr@kernel.org \
--cc=daniel.machon@microchip.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=david.rhodes@cirrus.com \
--cc=djbw@kernel.org \
--cc=djrscally@gmail.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=horatiu.vultur@microchip.com \
--cc=ira.weiny@intel.com \
--cc=jic23@kernel.org \
--cc=lenb@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=luca.ceresoli@bootlin.com \
--cc=patches@opensource.cirrus.com \
--cc=rafael@kernel.org \
--cc=rf@opensource.cirrus.com \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=saravanak@kernel.org \
--cc=steen.hegelund@microchip.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=ulf.hansson@linaro.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox